mongoose-q
WANTED: looking for new maintainer or contributor
kriskowal's Q support for mongoose.
for mongodb native nodejs driver, see mongo-q.
usage
to apply Q with default suffix 'Q':
var mongoose = ;// verbose way: mongooseQ is unusedvar mongoose = mongooseQ = mongoose// shortest way: mongoose will be loaded by mongoose-qvar mongoose = ;
to apply another Q implementation(since v0.0.15):
// to use bluebirdvar mongoose = q:;
model
statics:
use Q-applied SomeModel ;
model
methods:
use Q-applied var someModel = ...;someModel ;
query
methods:
use Q-applied SomeModel // no 'Q' suffix for Query methods except for execQ() ;
aggregate
methods:
use Q-applied SomeModel // no 'Q' suffix for Aggregate methods except for execQ() ;
suffix
/prefix
:
to apply Q with custom var mongoose = prefix:'promiseOf_' suffix:'_withQ';SomeModel ;
mapper
:
to apply Q with custom name { return 'q' + name + name;}var mongoose = mapper:customMapper;SomeModel ;
spread
:
DEPRECATED to apply Q with NOTE: since mongoose 4.x: no spread for update()!
NOTE: without
spread
option(by default), you can access only the first result withthen
!!
var mongoose = spread:true;SomeModel ;SomeModel ;...var model = ;...model ;...model ;
to define custom statics/instance methods using Q
NOTE: this is not a feature of mongoose-q
SomeSchemastatics { return this; // NOTE: returns Promise object.};...var SomeModel = mongoose;SomeModel;
That's all folks!