title: updating mongodb with a value which is map which contains a key with '$' in JAVA
body: <p>I am trying to update mongoDB with a map as a value. This map contains a key which has '$' character in it.</p>
  
  <p>I get following error:</p>
  
  <pre><code>java.lang.IllegalArgumentException: fields stored in the db can't start with '$' (Bad Key: '$format')
  </code></pre>
  
  <p>My code is:</p>
  
  <pre><code>        DB db = new MongoPersistenceManagerImpl().getDB();
          DBObject q = new BasicDBObject();
  
          DBObject u = new BasicDBObject();
          u.put("details", details);
  
          DBCollection collection = db.getCollection(COLLECTION_NAME);
          WriteResult result = collection.update(q, u, true, false);
  </code></pre>
  
  <p>where details is </p>
  
  <pre><code>private Map&lt;String, Object&gt; details;
  </code></pre>
  
  <p>One of the key in the "details" map has '$' in it which does not allow me to update mongoDB with the error mentioned above.</p>
  
  <p>The key looks like:</p>
  
  <pre><code>http://example.com?$format
  </code></pre>
  
  <p>Please provide pointers to resolve this.</p>