-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support more projection operators #529
Comments
+1 This would be very useful |
Our support for projection operators is a bit of a mess right now... It's not cohesive nor documented well. https://docs.mongodb.com/manual/reference/operator/projection/ specifies 4 projection operators as of v3.4:
On top of that, there's already some custom code for dealing with slices which allows for a more MongoEngine-like notation:
That being said, I don't like its implementation. It seems confusing that it's implemented as a prefix whereas in MongoDB/PyMongo
I'd much rather either re-implement it as a suffix (e.g. I'm even more conflicted though because the PyMongo way doesn't allow us to use the $ projection easily (e.g. Guess the alternative would be to re-implement
I just hate this because it adds bloat that doesn't provide any extra functionality on top of what PyMongo already provides... It also has to be maintained, tested, etc., and when MongoDB adds an operator, we need to add it, too. We already do something like this in many other places (update operators, for instance), but is that strong enough of an argument to just keep doing it? |
Was this ever implemented? |
Any update on this? |
Doc.objects(myList=1).fields(myList__S=1)
Refs: #525
The text was updated successfully, but these errors were encountered: