Dot allowed in key names

XMLWordPrintableJSON

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

      I can save a key with a "dot" using the latest Java client.

      This should not be allowed.

      import com.mongodb.Mongo;
      import com.mongodb.DBCollection;
      import com.mongodb.BasicDBObject;
      import com.mongodb.DB;
      
      public class Test {
      
          public static void main(String[] args) throws Exception {
      
              Mongo m = new Mongo();
              DB db = m.getDB("test_db_1");
              DBCollection coll = db.getCollection("test_collection_1");
      
              BasicDBObject doc = new BasicDBObject();
              doc.put("name.first", "First Name");
              doc.put("name.last", "Last Name");
              coll.insert(doc);
      
          }
      }
      

              Assignee:
              Antoine Girbal (Inactive)
              Reporter:
              Tsz Ming Wong
              None
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: