LearnBoost/mongoose — Issue #567: Specify DB for Populate?
Author: entourage
Created: 2011-10-15 03:19:49+00:00
State: open

├─┬ mongoose@2.1.2

Currently you can specify a schema, but it uses the same database of the model you're querying. Is there a way to specify the db to query such as, or even just use the DB of that model that you've defined:

http://www.mongodb.org/display/DOCS/Database+References

Syntax for a DBRef reference value is

{ $ref : , $id : [, $db : ] }

Currently, the User model exists in DB a, Projects model exists in DB b -- Projects references the User model, but when populate is called, a "user" collection is created in DB b instead of searching through users in DB a.

Thanks--