Java Driver can not update embedded array document

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.12.3
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      this command:
      db.collection.update(

      { <query selector> }

      , { <update operator>:

      { "array.$.field" : value }

      } )
      use array.$.field" as BasicDBObject key, the exception say:

      Exception in thread "main" java.lang.IllegalArgumentException: Document field names can't have a . in them. (Bad Key: 'dimensionArray.$.v')
      at com.mongodb.DBCollection.validateKey(DBCollection.java:1843)
      at com.mongodb.DBCollection._checkKeys(DBCollection.java:1803)
      at com.mongodb.DBCollection._checkObject(DBCollection.java:1790)
      at com.mongodb.DBCollectionImpl.update(DBCollectionImpl.java:256)
      at com.mongodb.DBCollection.update(DBCollection.java:191)
      at com.mongodb.DBCollection.update(DBCollection.java:224)

            Assignee:
            Ross Lawley
            Reporter:
            Tao Lin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: