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

Java driver fails to detect fields with dots (.) under certain circumstances

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.9.2, 2.10.1
    • Component/s: API
    • None
    • Environment:
      $ java -version
      java version "1.6.0_43"
      Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-10M4203)
      Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)

      Using the java driver (I tried 2.9.2 and 2.10.1), I am able to create a document with field names with dots (.) in them.

      Document:

      {
        "_document_" : {
          "subdoc1" : {
            "subdoc2" : [
              {
                "field.with.dots" : {}
              }
            ]
          }
        }
      }
      

      (note I've stripped out some other fields which I believe are irrelevant to this bug, but let me know if this example does not reproduce for you)

      If, however, I try to create this document from the Mongo shell, it properly detects the field with dots and returns an error:

      > db.dots.insert({"_document_":{"field1_1":{"field1_1_1":[{"field.with.dots":{}}]}}})
      Wed Mar 27 13:01:05 uncaught exception: can't have . in field names [field.with.dots]
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            caleb.jones@disney.com Caleb Jones
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: