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

mongorestore silently ignores documents with invalid field names starting with $

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.0.7, 2.2.0-rc2
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:
    • Operating System:
      ALL

      Description

      In MongoDB 2.0.7 it is possible to update() a document and set an invalid field name starting with $:

      > db.test.insert({_id: "foo"})
      > db.test.update({_id: "foo"}, {$set: {$set: "bar"}})
      > db.test.find({_id: "foo"})

      If you mongodump and then mongorestore this database, documents with invalid field names are silently ignored (even with `mongorestore -vvvvv`).

      In MongoDB 2.2.0rc2 the attempt to update() does throw an exception:

      Modified field name may not start with $

      .. but mongorestore still does not report any errors for skipped documents.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              stennie Stennie Steneker
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: