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

"update" can produce documents with dotted field names

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • 3.5.8
    • None
    • Querying
    • None
    • Fully Compatible
    • ALL

    Description

      In MongoDB 3.4.4 with latest PyMongo, this raises an error:

      from pymongo import MongoClient
       
      db = MongoClient().test
      db.collection.insert({'_id': 1, 'hello': 'world'})
      db.collection.update({'hello': 'world'},
                           {'_id': 1, 'hello': 'world', 'a.b': 'c'})
      

      The server returns:

      {'index': 0, 'code': 57, 'errmsg': u"The dotted field 'a.b' in 'a.b' is not valid for storage."}
      

      In the latest nightly (commit 6fe7250) on macOS, this script succeeds and updates the document. The collection now contains this document:

      { "_id" : 1, "hello" : "world", "a.b" : "c" }
      

      Attachments

        Issue Links

          Activity

            People

              backlog-server-query Backlog - Query Team (Inactive)
              jesse@mongodb.com A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: