Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-789

Dots allowed in field names of objects in a list

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.10.1
    • Component/s: None
    • None
    • Environment:
      mongo 2.2.3, java 1.6, mongo java driver 2.7.1, although tested with 2.10.1.

      I've ran into an issue where dots are allowed in object keys when the object is in a list, but not in allowed in embedded map or document key names. After further reading, I discovered that dots are not allowed in any mongo key.

      This example fails using the "Try it out" browser shell on the mongo home page but works using the latest version of the java driver.
      > db.test.insert({test:[

      {'0.0':'test'}

      ]})
      JS Error: can't have . in field names [0.0]

      I also attached the groovy script that I used to verify that this is an issue with the latest version of the driver.

        1. dotinname.groovy
          0.6 kB
          Dan Polites

            Assignee:
            Unassigned Unassigned
            Reporter:
            danpolites Dan Polites
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: