mongodb-odm
mongodb-odm copied to clipboard
No support for $[<identifier>] / arrayFilters right?
Can't seem to find any reference. Although it is part of 3.6+ ... https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/
Would love to see it implemented, but I can use workarounds for now :)
Correct, there is no support for those yet. We'll support them in 2.x once we're done with the driver switch.
2 years and half later, any news about integration of arrayFilters ?
Nope. I experimented using them for collection updates, but that would require a significant overhaul (read "rewrite") of the persister logic which I didn't find the time for.
Obviously, the first step would be to add support for this in the query builder. I'm interested in your use-case: what would you like to use it for, do you use it already (e.g. by sending updates through the driver itself), etc. Maybe we can find a quick way to get that into 2.2. Ironically, one of the reasons I didn't get around to building anything is that I stopped using the ODM 2 years ago when I joined MongoDB, hence my question about your use-case to come up with an API for this.
Thank you for your answer.
My use case is to replace an array value with a single query (like that: https://stackoverflow.com/a/58973094/6911841). In the mean time I make two separates queries, one pull and one push, that is not very optimal.
Hi, anything change in this issue pls? Thanks
Hi accually right now there is only workaround array filter given as array parameter in getQuery
Ok and can you show me an example of this workaround pls? Thanks