Blank key in embedded doc seems to prevent findAndModify from applying modifier

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.4
    • Affects Version/s: 2.0.7, 2.2.0
    • Component/s: Write Ops
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Reproduce with this (ops must be applied in order):

      db.test.insert({'name': 'TEST'})
      db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test.one': 1}}, new:true})
      db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test..foo': 1}}, new:true})
      db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test.two': 1}}, new:true})
      

      The second findAndModify statement creates an embedded doc under a blank key ("").
      The subsequent call to findAndModify in the last line, even when executed multiple times, never seems to actually increment the counter.

            Assignee:
            Unassigned
            Reporter:
            Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: