[FireStore Question] What's difference between Unary.IsNull and Binary.Equal null ? Are there Unary.NotNull?
See original GitHub issueWhat’s difference between Unary.IsNull and Binary.Equal null ?
Is it has any difference behavior? Can we use it to find document that has specific field exist or not exist?
At first I look at UnaryOperator to find operator for NotNull
I have document like this
{
"_id" : "1",
"result" : {}
}
{
"_id" : "2"
}
{
"_id" : "3",
"result" : {}
}
I want to query for all document that already has any result. And also I want to query for any document that don’t has any result yet too, how should I make query?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14
Top Results From Across the Web
Operators | BigQuery
Value is [not] in the set of values specified, Binary. IS [NOT] NULL, All, Value is [not] NULL, Unary. IS [NOT] TRUE, BOOL,...
Read more >Firestore select where is not null
Firestore has no "not equal" operator. But looking at the logic, what you're trying to do is query for values which are String...
Read more >Functions, operators, and conditionals | BigQuery
Value is [not] in the set of values specified, Binary. IS [NOT] NULL, All, Value is [not] NULL, Unary. IS [NOT] TRUE, BOOL,...
Read more >Why is my currentUser == null in Firebase Auth?
Auth state seems binary: null or non-null (or is it?) Here's an easy enough bit of code in JavaScript that checks to see...
Read more >Get doc by id firestore. uid
I trying to get the document id of a document in firestore but i get a random ... You have to make sure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Firestore distinguishes between two kind of queries. Most types allow inequality comparisons (such as
>=
), but NaN and Null only allows for equality. In this specific example, you can work around this withstartAfter
. For now,where("a",">=",null)
unfortunately does not work directly.Yes, you can sort types against one another. Specifying
> null
would return everything that is defined and notnull
sincenull
sorts first in Firestore. I don’t know out of the top of my head if we have any publicly available documentation on our ordering semantics, but you can take a look here to see how types compare: https://github.com/googleapis/nodejs-firestore/blob/master/src/order.js#L29