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

"update" can produce documents with dotted field names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.5.8
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      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

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

                Dates

                Created:
                Updated:
                Resolved: