This package has been deprecated

Author message:

No longer maintained.

mongoose-link

0.1.2 • Public • Published

mongoose-link NPM version Build Status Dependency Status

Link related documents from a mongoose query.

This module provides an alternative way to populate related (linked) documents from a mongoose query.

It does not depend on _id.

Install

$ npm install --save mongoose-link

Usage

var link = require('mongoose-link');
var Comment = require('./Comment');
var User = require('./User');
 
Comment.
find().
lean().
exec().
then(link.sync(User, 'created_by:user',{email:true}, {lean:true})).
then(function(comments) {  
  //Comments should look like {_id:'5325245af32e34634363', user:{email:'x@x.com'}}
})
 

License

Apache-2.0 © Lasana Murray

Dependencies (1)

Dev Dependencies (4)

Package Sidebar

Install

npm i mongoose-link

Weekly Downloads

0

Version

0.1.2

License

Apache-2.0

Last publish

Collaborators

  • metasansana