compound query with != operator always returning 0 documents
coddamn opened this issue · comments
I want to track users nearby where 'userId' != this.myUserid.
but the query doesn't return the result expected
this is the code I am running :
const userRef = firestore().collection('users').where('userId','!=',this.uid).orderBy('userId');
const usersRef = firestore().collection("users");
this.watch = Plugins.Geolocation.watchPosition(
{ maximumAge: 0, timeout: 5000 },
(geoPosition) => {
if (geoPosition) {
console.log(geoPosition);
const field = "position";
const center = this.geo.point(geoPosition.coords.latitude,geoPosition.coords.longitude);
const position = this.geo.point(
geoPosition.coords.latitude,
geoPosition.coords.longitude
);
usersRef.doc(this.uid).set({ position }, { merge: true });
this.points = this.radius.pipe(
switchMap((r) => {
return this.geo.query(userRef).within(center, r, field, {log: true});
}),
shareReplay(1)
);
}
}
);