I am trying to find a simple query where will be able to get all the documents where one map object property exists and one map object property doesn't exist. How can I do that
Here is the document on which I want to query. Basically, I want to query the collection where these conditions meet
CodePudding user response:
Currently there isn't any way to query documents based on existence of a field.
One work around is to use orderBy("userContributionData")
in your query which will return documents where this field exists and then manually removing documents where subscriptionData
field is missing.
Another way would be set default value of the field to null
so you can use a where('field', '==', null)
clause.