You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Database.MongoDB.Query doesn't expose the full power of mongo's update call. Here are a couple specific issues (not intended as a comprehensive list):
There's no way to make a call with both the MultiUpdate and Upsert flags.
There's no (semantic) way to make a modify call that only modifies one document or that does an upsert (or both, see previous).
The rest of the module does a good job of mirroring mongo's query API without restricting its use. So the update functions seem out of place, in that they sacrifice "advanced" usage in favor of several predetermined modes of operation.
I haven't dug into this very much, but it seems like you could just expose update (a private function in the Query module). The convenience functions (save, replace, repsert, etc.) could remain as such or be deprecated.
The text was updated successfully, but these errors were encountered:
There's no way to make a call with both the MultiUpdate and Upsert flags.
What is the semantics of calling update with both these flags? Upsert means insert the document if there's nothing to update, while MultiUpdate updates 1+existing documents. I think a more transparent way of achieving the behaviour you aim for is making two separate calls.
I think the driver should expose an unrestricted interface (that it is possible for a user to shoot themselves in the foot with) in addition to a higher-level/safer interface for advanced use cases
Database.MongoDB.Query
doesn't expose the full power of mongo's update call. Here are a couple specific issues (not intended as a comprehensive list):MultiUpdate
andUpsert
flags.modify
call that only modifies one document or that does an upsert (or both, see previous).The rest of the module does a good job of mirroring mongo's query API without restricting its use. So the update functions seem out of place, in that they sacrifice "advanced" usage in favor of several predetermined modes of operation.
I haven't dug into this very much, but it seems like you could just expose
update
(a private function in theQuery
module). The convenience functions (save
,replace
,repsert
, etc.) could remain as such or be deprecated.The text was updated successfully, but these errors were encountered: