Closed appjitsu closed 7 years ago
Or maybe dynamic references? http://mongoosejs.com/docs/populate.html#dynamic-ref
Yeah this plugin should handle dynamic refs transparently, just attach autopopulate: true
to mount
. This plugin is a very thin wrapper around populate()
, all it does is add pre('find')
and pre('findOne')
hooks that attach the correct populate()
calls.
Not only on _id but also some other field?
So given the above schema, I want to populate on both the _id and the mount. Mount is a foreign key.
So something like this is my use case:
So I need to pull docs for '_id' from the actions collection and docs for 'mount' from the lists collection.