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

Upsert allows inserting records with dots in key names

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.7.4
    • 1.6.2
    • None
    • None
    • linux 32 bit
    • Linux

    Description

      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 }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: