How do I query a firebase collection by the 'not in' parameter with more than 10 values?

Issue

I have a contact list:

[
"abc"
"def"
]

and chat records that have the following format

from :"dpasha52"
to: "jbabu"
text: "some message"
timestamp :1 September 2021 at 17:57:02 UTC+5:30

I need to query firebase collection such that

===========>not in takes contact list

this.angf.collection('Chats', ref => ref.where('from',not in, ["","",""]).where('to','==',this.userinfo.name))
               .valueChanges();

the only problem is not in only allows 10 entries.

is there any way to include more than 10 entries?

Solution

the only problem is not in only allows 10 entries

Yes, that is correct, you can only perform a query up to 10 entries.

How do I query a firebase collection by the ‘not in’ parameter with more than 10 values?

If you have more than 10 entries, then you should consider retrieving the entries in batches, and then process the entries that are coming from each separate query either sequentially or in parallel.

Is there any way to include more than 10 entries?

No, currently there is not.

Answered By – Alex Mamo

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published