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

Dot allowed in key names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.5
    • Component/s: None
    • Labels:
      None

      Description

      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);
       
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              antoine Antoine Girbal
              Reporter:
              tszming Tsz Ming Wong
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: