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

Duplicate fields at the same level should not be allowed

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Major Change
    • Case:

      Description

      Disallow writing new documents with duplicate field names at the same level, like:

      {a:1, a:2}

      In previous versions of mongodb, updates could be written to produce duplicate fields, but can no longer be as of 2.6.

      For existing data, one should be able to replace the existing "bad" documents with "fixed" versions.

      Note: Documents which already exist should still be replicated and migrated during system operations, but cannot be modified without "fixing" them.

      Clients: Some client will error if they encounter duplicate field names in a document, like .net; in javascript and other languages one of the fields may be hidden or lost since the native storage is a map where keys (field names) are unique.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated: