Firestore Error. may not have more than 100 filters

121 views
Skip to first unread message

Philip Ashton

unread,
Mar 24, 2019, 11:11:30 AM3/24/19
to Firebase Google Group
On a get from firestore I am getting the following error.

INVALID_ARGUMENT: The query may not have more than 100 filters + sort orders + ancestor total. Currently there are 101 filters, 2 sort orders, and no ancestor filter

The list does have 100 .where(field, "==", false) clauses plus one order field.

Is this a hard limit, or can it be increased? Can anyone point me to documentation on this?

Philip

Tyler Rockwood

unread,
Mar 24, 2019, 4:54:49 PM3/24/19
to Firebase Google Group
Hey Philip,

Thanks for writing in! This is a hard limit, but it seems our documentation doesn't have this stated. I'll make sure to get that updated.

What's your use case for this? Are these 100 unique fields?

-Tyler

Philip Ashworth

unread,
Mar 24, 2019, 7:12:51 PM3/24/19
to fireba...@googlegroups.com
Hi.

They are 100 unique fields in a map field. It is a workaround for the lack of IN or OR for different categories of data. We have up to 100 (we have culled them to 97) as we also have 3 other fields needed.

It is not ideal but allows us to do the equivalent of 10 or 20 or statements by reversing the logic.

Yours,

Philip

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/l3GELcmdx0E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b5a44849-35e0-493e-959b-38d17e8786b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kato Richardson

unread,
Mar 25, 2019, 7:10:44 PM3/25/19
to Firebase Google Group
Can you provide a more concrete example of what this might look like (maybe providing say 5 of the conditions needed) and why you can't just run two queries and aggregate them as suggested in the docs?

This feedback would be very helpful in understanding what additional functionality is needed.

☼, Kato

You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

F. Zafer KAYIKÇILAR

unread,
Jan 23, 2020, 9:45:03 AM1/23/20
to Firebase Google Group
I got same error when i try to send notification that more than 100:

const allTokens = await admin
.firestore()
.collection('Devices')
.where('personId', 'in', clubInfo.docs[0].get('followers'))
.get();

On Tuesday, March 26, 2019 at 2:10:44 AM UTC+3, Kato Richardson wrote:
Can you provide a more concrete example of what this might look like (maybe providing say 5 of the conditions needed) and why you can't just run two queries and aggregate them as suggested in the docs?

This feedback would be very helpful in understanding what additional functionality is needed.

☼, Kato

On Sun, Mar 24, 2019 at 4:12 PM Philip Ashworth <phi...@igov.direct> wrote:
Hi.

They are 100 unique fields in a map field. It is a workaround for the lack of IN or OR for different categories of data. We have up to 100 (we have culled them to 97) as we also have 3 other fields needed.

It is not ideal but allows us to do the equivalent of 10 or 20 or statements by reversing the logic.

Yours,

Philip

On Sun, 24 Mar 2019, 21:55 'Tyler Rockwood' via Firebase Google Group, <fireba...@googlegroups.com> wrote:
Hey Philip,

Thanks for writing in! This is a hard limit, but it seems our documentation doesn't have this stated. I'll make sure to get that updated.

What's your use case for this? Are these 100 unique fields?

-Tyler

On Sunday, March 24, 2019 at 10:11:30 AM UTC-5, Philip Ashton wrote:
On a get from firestore I am getting the following error.

INVALID_ARGUMENT: The query may not have more than 100 filters + sort orders + ancestor total. Currently there are 101 filters, 2 sort orders, and no ancestor filter

The list does have 100 .where(field, "==", false) clauses plus one order field.

Is this a hard limit, or can it be increased? Can anyone point me to documentation on this?

Philip

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/l3GELcmdx0E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fireba...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b5a44849-35e0-493e-959b-38d17e8786b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.

Tyler Rockwood

unread,
Jan 31, 2020, 10:30:56 AM1/31/20
to Firebase Google Group
Reply all
Reply to author
Forward
0 new messages