This repository has been archived by the owner on Feb 10, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 103
[v3] save won't return the saved document #156
Comments
Sorry, after looking into the source deeper, I find out the code could change to something like const doc = new Doc({ ...attrs })
doc.save()
return doc but returning the model instance still could be very helpful. |
Could you explain where it could be useful? |
Actually, the main reason is this breaking my code when upgrading from v2. In v2, I have some code like this, and not working anymore. This might be not a big deal, some document could help. const post = (new Post({ title: 'Some title' })).save() https://github.com/vadimdemedes/mongorito/blob/master/lib/mongorito.js#L609 |
This is a good point, I think I'd like that too. |
Save method is async process so it return Promise, why it should return something else? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Looks like create/update have the same problem. Since bluebird is not used anymore, I highly recommend sindresorhus's p-tap package.
The text was updated successfully, but these errors were encountered: