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

mongorestore silently ignores documents with invalid field names starting with $

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.7, 2.2.0-rc2
    • Component/s: Tools
    • Labels:
    • ALL

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: