Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isNotEqualTo error #129

Open
CripyIce opened this issue Dec 21, 2020 · 3 comments
Open

isNotEqualTo error #129

CripyIce opened this issue Dec 21, 2020 · 3 comments

Comments

@CripyIce
Copy link

Hi,
When trying to get stream with the following collection my function stops running (no errors):

_firestore
   .collection("pending_list")
   .where(FieldPath.documentId, isNotEqualTo: _auth.currentUser.uid)
   .where("interest", isEqualTo: "male")
   .where("gender", isEqualTo: "female")
   .where("age", isEqualTo: 1)

But when removing isNotEqualTo query it seems to work.
Any ideas? When running the above query with a simple .get()..docs everything works fine.
Thanks!

@yevgeniaronov
Copy link

yevgeniaronov commented Mar 24, 2021

i think you must add an orderBy and create an index.

ref = firestore
.collection('users')
.where('uid', isNotEqualTo: currentUid)
.orderBy('uid');

geo
.collection(ref: ref )
.within(center: centerPoint, radius: 0.5, field: 'location');

and the index i have is uid Ascending location.geohash Ascending.

it fixed the errors i had with this stream.
i dont know if its the same issue, but it might help.

btw, the errors were:
Failed assertion: line 258 pos 18: 'field == orders[0][0]': The initial orderBy() field '[[FieldPath([location, geohash]), false]][0][0]' has to be the same as the where() field parameter 'FieldPath([uid])' when an inequality operator is invoked.

@yevgeniaronov
Copy link

actually, the solution i provided before doesn't work, it just clears out the error, but the stream is empty (even though it should provide data).
in constrast isEqualTo combination works fine.

might be a bug..

@WieFel
Copy link

WieFel commented Aug 5, 2022

Any solution to this? I am having the exact same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants