Firestore query does not accept "!=" operator
Closed this issue · 2 comments
cayeborreo commented
Minimal code to reproduce the problem
const firestore = FirestoreApp.getFirestore(email, key, projectId);
const allData = firestore.query("table")
.Where("availability", "!=", "")
.Execute();
Logger.log(allData);
Expected Behavior
- Return user documents that fulfill query - ie exclude documents where the
availability
field is null
Actual Results
Library Version:
33
cayeborreo commented
Made do with a workaround:
const allData = firestore.query("table")
.Where("availability", ">", "")
.Execute();
LaughDonor commented
We just try to translate the original API, and the !=
and not null
are not part of the spec.
I was going to suggest that you try the > ""
approach, but seems like you found it!