[DOCS-2605] Clarify remove() method Behavior Created: 28/Jan/14  Updated: 08/Dec/16  Resolved: 28/Jan/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.0

Type: Improvement Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: sprint-slipstream
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/manual/reference/method/db.collection.remove/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
Referrer: https://www.google.co.in/
Screen Resolution: 2048 x 1152
repo: docs
source: reference/method/db.collection.remove


Participants:
Days since reply: 10 years, 3 weeks, 1 day ago

 Description   

why does "remove" delete all matching records by default? dont you think the default option should be to delete only first matching record and if required user will pass "false" for second parameter to remove all records.

im new to mongo and i made a mistake of passing bad query to "remove" and it resulted in deletion of > 10 millions documents



 Comments   
Comment by Githook User [ 28/Jan/14 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-2605: clarify organization of db.collection.remove
Branch: master
https://github.com/mongodb/docs/commit/1cba1f4a7f81c297f7580ff91f760ce6391d8d94

Comment by Githook User [ 28/Jan/14 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-2605: clarify organization of db.collection.remove
Branch: v2.4
https://github.com/mongodb/docs/commit/d5512287f8f3b6f80d9c0235a13d9a107ef5db8c

Generated at Thu Feb 08 07:43:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.