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

findAndModify allows invalid field names on update but not insert

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.0.1
    • Component/s: Write Ops
    • None
    • ALL

      > db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te$t" : true }}}, "upsert": true, "new": true});
      Tue Dec 06 19:08:10 uncaught exception: findAndModifyFailed failed: "not okForStorage"
      > db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te.t" : true }}}, "upsert": true, "new": true});
      Tue Dec 06 19:08:15 uncaught exception: findAndModifyFailed failed: "not okForStorage"
      > db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "test" : true }}}, "upsert": true, "new": true});
      { "_id" : 1, "test" : { "test" : true } }
      > db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te$t" : true }}}, "upsert": true, "new": true});
      { "_id" : 1, "test" : { "te$t" : true } }
      > db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te.t" : true }}}, "upsert": true, "new": true});
      { "_id" : 1, "test" : { "te.t" : true } }
      

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            tonyh Tony Hannan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: