Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongoose promisification. #241

Closed
Volox opened this issue Jun 23, 2014 · 1 comment
Closed

Mongoose promisification. #241

Volox opened this issue Jun 23, 2014 · 1 comment

Comments

@Volox
Copy link

Volox commented Jun 23, 2014

Hello,
i have a question on promisification. Following the API docs is written that i can promisify Mongoose with just:

var mongoose = require( 'mongoose' );
Promise.promisifyAll( mongoose );

But then when i try to save a document my promise hang there.

var user = new User( {
  username: 'username'
} );

user
.saveAsync()
.then( function() {
  debug( 'user saved' ); // Never gets called
});

I also checked yamadapc/mongoose-bluebird-utils#1 but with no luck. Any seggestion on how to use bluebird with Mongoose.

@Volox
Copy link
Author

Volox commented Jun 23, 2014

Sorry it was my fault.
I was doing something wrong with the Mongoose connection and model instances.

See Automattic/mongoose#2157 for details about my connection problem.

@Volox Volox closed this as completed Jun 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant