Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42597

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Shell
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: