title: MongoDB - Create object with reference manually - DBRef doesn't work
body: <p>for testing purposes I need to create manually some objects in a MongoDB. My Class has a reference field to another class. The referred object already exists. </p>
  
  <p>I tried to put the Mongo-ID of my existing object as a value in my new object but I get the following error:</p>
  
  <blockquote>
    <p>A ReferenceField only accepts DBRef: ['attribute'])</p>
  </blockquote>
  
  <p><strong>Now my question: Where do I get or find this <code>DBRef</code>?</strong></p>
  
  <hr>
  
  <p>An example:
  I have a user in my db. I want to create a group which has the existing user as <code>"creator"</code>. When I put the user-ID into the creator-field I get the error...</p>
  
  <p>Edit:</p>
  
  <p>I just found this link <a href="https://stackoverflow.com/questions/8713304/mongodb-dbref">MongoDB - DBRef</a> but the solution does not work for me...</p>
  
  <pre><code>item : {"$ref" : "fruit", "$id" : "1"}
  </code></pre>
  
  <p>My code is like this:</p>
  
  <pre><code>{ "name" : "MyGroup", "created_at" : "2011-05-22T00:46:38", "creator": { "$ref": "user", "$id": "501bd5ac32f28a1278e54435" } }
  </code></pre>
  
  <p>Another edit:</p>
  
  <p>Even the Mongo doc says I'm using the right format... <a href="http://www.mongodb.org/display/DOCS/Mongo+Extended+JSON" rel="nofollow noreferrer">http://www.mongodb.org/display/DOCS/Mongo+Extended+JSON</a>. But still not working.</p>