title: Mongoose DBRef implementation is not the same like in MongoDB documentation
body: <p>I have big problem with maybe trivial problem. I'm trying to use <code>reference</code> with mongoose.js for MongoDB database. Let's take a look on this example:</p>
  
  <h2>Example code:</h2>
  
  <p><a href="https://gist.github.com/hastebrot/1170907" rel="nofollow">https://gist.github.com/hastebrot/1170907</a></p>
  
  <p>When I run this code I have something like that in my db:</p>
  
  <pre><code>&gt; db.stories.find()
  { 
    "title" : "A man who cooked Nintendo",
    "_creator" :  ObjectId("52e7dc001bdedb703df29b8e"),
    "_id" : ObjectId("52e7dc001bdedb703df29b8f"),
    "fans" : [ ], "__v" : 0
  }
  
  &gt; db.people.find()
  {
    "name" : "Aaron",
    "age" : 100,
    "_id" : ObjectId("52e7dc001bdedb703df29b8e"),
    "stories" : [ ], "__v" : 0
  }
  </code></pre>
  
  <h2>Where is the problem?</h2>
  
  <p>In case where I insert data using mongoose and read references using mongoose all is fine. <strong>But</strong> when db is fetched by Java program with own layer for mongoDB then problem appear.</p>
  
  <p>This Java program add something like that into db (this is another example don't look on not matched field):</p>
  
  <pre><code>//other fields
  "user": {
      "$ref": "users",
      "$id": {
          "$oid": "52c6c497c08e6fcf37000001"
      }
  }
  </code></pre>
  
  <p>When we go to documentation of MongoDB (<a href="http://docs.mongodb.org/manual/reference/database-references/#dbrefs" rel="nofollow">http://docs.mongodb.org/manual/reference/database-references/#dbrefs</a>) we can read that reference property need <code>$ref</code> and <code>$id</code> fields.</p>
  
  <h2>Question:</h2>
  
  <p>So is it problem with wrong implementation mongoDB DBRef type into mongoose or I'm doing something wrong?</p>