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

"update" can produce documents with dotted field names

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.8
    • Component/s: Querying
    • None
    • Query
    • Fully Compatible
    • ALL

      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" }
      

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

              Created:
              Updated:
              Resolved: