[CDRIVER-635] The multi option should be true by default Created: 05/May/15  Updated: 03/May/17  Resolved: 06/May/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Billy Tetrud Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DRIVERS-220 Implement CRUD API spec Closed
Backwards Compatibility: Minor Change

 Description   

I just wasted a crapload of my time trying to figure out why one of my documents was updating and not another. It makes absolutely no sense that multi isn't the default. If you're trying to be "safer" well I'm wondering exactly who you're protecting, since any situation where it would be unsafe is also a situation where its unsafe to just let people run wild with the interactive console.



 Comments   
Comment by Billy Tetrud [ 06/May/15 ]

Sounds like that's the right approach, thanks Jesse!

Comment by A. Jesse Jiryu Davis [ 06/May/15 ]

So sorry for the trouble. I agree that the behavior of "multi" is bad, but it's too late to change it. It's been that way from the beginning and multi consistently defaults to "false" across the MongoDB shell and all drivers:

http://docs.mongodb.org/manual/reference/method/db.collection.update/

Since we can't fix it without breaking everyone's existing code, we're replacing the bad "update" API with new, clear APIs "updateOne" and "updateMany":

http://www.mongodb.com/blog/post/consistent-crud-api-next-generation-mongodb-drivers

I didn't have a ticket to track the implementation of this new spec in libmongoc, so I've opened one: CDRIVER-637.

Comment by Billy Tetrud [ 05/May/15 ]

This should be part of the Core Server project - i couldn't find that in the list or didn't see it

Generated at Wed Feb 07 21:10:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.