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

mongo shell doesn't support inserting documents with duplicate field names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.6.7, 4.0.0
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:
      None
    • Environment:
      Windows
    • Operating System:
      ALL

      Description

      Example shell output:

      > db.dup.insert({_id:1, a:1, a:2})
      WriteResult({ "nInserted" : 1 })
      > db.dup.find()

      { "_id" : 1, "a" : 2 }

      InsertMany has the same problem:

      > db.dup.insertMany([\{_id:1, a:1, a:2},\{_id:2,a:1,a:2}])

      { "acknowledged" : true, "insertedIds" : [ 1, 2 ] }

      > db.dup.find()

      { "_id" : 1, "a" : 2 } { "_id" : 2, "a" : 2 }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: