
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
mongoose-bird
Advanced tools
blue bird support for mongoose.
based on mongoose-2.
mongoose-bird uses the bluebird's Promise.promisifyAll function which will add a Async function for each function on mongoose :
So all mongoose-bird does it to call:
Promise.promisifyAll(mongoose.Model);
Promise.promisifyAll(mongoose.Model.prototype);
Promise.promisifyAll(mongoose.Query.prototype);
var mongoose = require('mongoose-bird')(require('mongoose'));
// verbose way: mongooseQ is unused
var mongoose = require('mongoose'),
mongooseBird = require('mongoose-bird')(mongoose)
// shortest way: mongoose will be loaded by mongoose-bird
var mongoose = require('mongoose-bird')();
model statistics functions:SomeModel.findByIdAsync(....blahblah...)
.then(function (result) { ... })
.catch(function (err) { ... });
model functions:var someModel = new SomeModel(...);
someModel.populateAsync()
.then(function (result) { ... })
.catch(function (err) { ... });
query methods:SomeModel.find(...).where(...).skip(...).limit(...).sort(...).populate(...)
.execAsync() // no 'Async' suffix for model statics except for execAsync()
.then(function (result) { ... })
.catch(function (err) { ... });
spread:var mongoose = require('mongoose-bird')(require('mongoose'));
SomeModel.updateAsync(...)
.spread(function (affectedRows, raw) { ... })
.catch(function (err) { ... });
...
var model = new SomeModel();
...
model.saveAsync()
.spread(function (savedDoc, affectedRows) { ... })
.catch(function (err) { ... });
...
SomeSchema.statics.findByName = function (name) {
return this.findAsync({name: name}); // NOTE: returns Promise object.
};
...
var SomeModel = mongoose.model('Some', SomeSchema);
SomeModel.findByName('foo').then(function(result) {
console.log(result);
});
NOTE: this is not a feature of mongoose-bird
That's all folks!
FAQs
blue bird support for mongoose
We found that mongoose-bird demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.