title: Mongo database Invalid BSON field name exception
body: <p>I tried to  follow this  <a href="https://stackoverflow.com/questions/8429318/how-to-use-dot-in-field-name">How to use dot in field name?</a>. But it result as the picture. There is a additional space:-</p>
  
  <p><a href="https://i.stack.imgur.com/1Yrbz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1Yrbz.png" alt="enter image description here"></a></p>
  
  <pre><code>  protected Document setNestedField(Document doc, FieldValue parentField, String nestedFieldName, Object value, boolean concatenate) {
              if (concatenate) {
                  doc.put(parentField.getSystemName() + "." + nestedFieldName, value);
              }
              else {
                  doc.put(nestedFieldName, value);
              }
              return doc;
          }
  </code></pre>
  
  <p>Exception:-Invalid BSON field name photographs.inner_fields; nested exception is java.lang.IllegalArgumentException: Invalid BSON field name photographs.inner_fields.</p>
  
  <p>How can I use dot "." in field name. I have to use . as I'm using some 3rd party api and I have no option to replace to something else like [dot]. Please suggest me?</p>