nl_tokens: Checks if the schema s property at path is a ref - or an Array of refs - and if yes adds a virtual property suffixed with P which returns a promise to the reference s query result ( s ) .
pl_tokens: function addVirtualRef ( schema , node , path ) { if ( _ . isArray ( node ) && isRef ( _ . <mask> ( node ) ) ) { schema . virtual ( path + 'P' ) . get ( function ( ) { if ( ! this [ path ] || ! this [ path ] . length ) return Promise . resolve ( [ ] ) ; var model = this . constructor . db . model ( _ . first ( node ) . ref ) ; return findAsync . call ( model , { $or : _ . map ( this [ path ] , function ( id ) { return { _id : id } ; } ) } ) ; } ) ; } else if ( isRef ( node ) ) { schema . virtual ( path + 'P' ) . get ( function ( ) { var model = this . constructor . db . model ( node . ref ) ; return findByIdAsync . call ( model , this [ path ] ) ; } ) ; } }