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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Shell
    • Server Tooling & Methods

    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

            backlog-server-stm Backlog - Server Tooling and Methods (STM) (Inactive)
            gar@cambly.com Gar Higgins
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: