[SERVER-31085] collection.remove(null) will remove all the documents in the collection. Created: 13/Sep/17  Updated: 27/Oct/23  Resolved: 14/Sep/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Olzhas Shaikenov Assignee: Kelsey Schubert
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

any


Participants:

 Comments   
Comment by Kelsey Schubert [ 14/Sep/17 ]

Hi olzhas.shaiken,

Thank you for the report. This is the expected behavior in the mongo shell, https://github.com/mongodb/mongo/blob/r3.4.9/src/mongo/shell/collection.js#L190-L192, which was introduced 9 years ago. Unfortunately, modifying this behavior would constitute a backwards-breaking change that may affect scripts that users have written over the past years. Consequently, after consideration, we've decided to maintain the current existing behavior.

Kind regards,
Kelsey

Generated at Thu Feb 08 04:25:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.