-
Notifications
You must be signed in to change notification settings - Fork 23
feat: Adopt filter types from mongodb and enhance strictness #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b020ad2 to
8242359
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really say that I fully understand all the TS, but a quick look doesn't raise any red flags for me.
You mentioned a few things in the PR description that I didn't quite follow, would you mind expanding on these, or pointing where they are in the code, for those following along at home?
- added $expr support to the root filter operators -- What is this? Why was this not supported by mongo?
- added support for non-indexed array elements in the dot-notation path algorithm, e.g. -foo.bar (where foo is an array of objects) -- What is the use case for this? Is this query pattern supported by the mongo server?
- added support for indexed array elements in the dot-notation path algorithm, e.g. foo.0 (where foo is an array of objects) -- surprised this wasn't supported by mongo if this is a valid query pattern, is this query pattern supported by the mongo server?
Also, I'm curious how we plan to keep these types in sync with mongodb types themselves.
https://www.mongodb.com/docs/v5.3/reference/operator/query/expr/
This was possible to use because of the
|
05acce9 to
ab1922b
Compare
1d0a0fe to
2fc4329
Compare
f5aa6ce to
2a0c81d
Compare
BREAKING CHANGE: Papr is using new internal stricter types for query filters and update filters: `PaprFilter` and `PaprUpdateFilter`.
2a0c81d to
58a50c4
Compare
Closes #410 #407
This PR brings the strict filter types from
mongodbinto our repository, which allows us to remove theDocumenttype and enhance the strictness of these types.Known divergence from the
mongodbtypes:$exprsupport to the root filter operators$elemMatchis applied only for array fieldsfoo.bar(wherefoois an array of objects)foo.0(wherefoois an array of objects)