db.collection.remove('') removes all documents

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • Server Tooling & Methods
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Running any of the following command removed all records from the table:

      • db.my_table.remove('')
      • db.my_table.remove('6717326742115057665')

      I would've expected these to both be rejected. I can't find anything in the documentation of collection.remove() that would indicate this is intended behavior.

      I verified this behavior using mongo shell v4.0.4 and mongodb v4.0.4.

              Assignee:
              Backlog - Server Tooling and Methods (STM) (Inactive)
              Reporter:
              Gar Higgins
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: