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

Upsert allows inserting records with dots in key names

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.7.4
    • Affects Version/s: 1.6.2
    • Component/s: None
    • None
    • Environment:
      linux 32 bit
    • Linux

      Insert does not allow inserting records with fields containing keys with dots in them, which as I understand it is the correct behaviour. An upsert however, will perfectly happily do this:

      > db.test.insert(

      { "test": 1, "te.st": 1 }

      );
      Fri Oct 22 17:13:37 uncaught exception: can't have . in field names [te.st]
      > db.test.update(

      { "test": 1 }

      ,

      { "test": 1, "te.st": 1 }

      , 1);
      > db.test.find()

      { "_id" : ObjectId("4cc1b8371c20e0349d6568ad"), "test" : 1, "te.st" : 1 }

            Assignee:
            antoine Antoine Girbal
            Reporter:
            abayliss Andrew Bayliss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: