title: Using and populating (real) DBRef arrays with Mongoose / mongoose-dbref
body: <p>Mongoose doesn't appear to support Mongo DBRefs. Apparently they released "DBRef" support but it was actually just plain references (no ability to reference documents from different collections). I've finally managed to craft a schema that allows me to hold an array of ObjectID references and populate them, which is great for certain parts of my schema, but it would be extremely convenient if I could use proper DBRefs to create an array that lets me refer to documents from a number of collections.</p>
  
  <p>Luckily(?) there's a module that can monkey patch DBRef support into mongoose: <a href="https://github.com/goulash1971/mongoose-dbref" rel="nofollow">https://github.com/goulash1971/mongoose-dbref</a></p>
  
  <p>Unluckily, I can't make any sense of the documents. The best I can tell is that there is no ability to use DBRefs in an array (there is a 'fetch' method to dereference, but it takes a single dbref); 'populate' doesn't seem to be patched to fill in DBRefs, and I can't tell how I'm supposed to <em>assign</em> a DBRef given a source document [collection.items.push(?????)].</p>
  
  <p>From the internet, it appears that I can assign an object of the form { $id: document._id, $ref: 'Collection' } -- when logging the result, it appears to have "taken" as a DBRef data type, but I am unsure if this is correct since I cannot seem to do anything useful with it (turn the ref back into a document).</p>
  
  <p>What I really want is a way to represent an ordered list of items from multiple collections; any solution to this is fine by me, but so far DBRefs are the best I've got. Help?</p>