feat: Add isNull QueryConstraint and set/foreset null operations #308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New Pull Request Checklist
Issue Description
null
or to set a value tonull
on the server.Related issue: #n/a
Approach
Add the
isNull
andisNotNull
query constraints along with the ability to set a field tonull
on the server when using operations. Note that this is different from querying fordoesNotExist
or using theUnset
operation which produces(undefined)
on the server (MongoDB and Postgres) and dashboard. Setting a value tonull
on a Parse Server using MongoDB produces(null)
. The results from using theisNull
QueryConstraint
will yield values that are either(null)
or(undefined)
. Using thedoesNotExist
QueryConstraint
yields results that are only(undefined)
. Conversely, similar behavior is added forisNotNull
andexists
. For Postgres, this doesn't matter, and the counterparts mentioned above produce the same results. For both MongoDB and Postgres, it recommended to setup your databases and query in a way that is efficient for your particular index's and setup.Improve
QueryWhere
by making at aSet
ofQueryConstraint
's instead of any array. This dedupes the same constraint when encoding the query, improving the encoding speed.TODOs before merging
throw
from operation methods which don't need to be thrown