8

New to mongoose & node.

I can't figure out if mongoose document.save method is async. I'm assuming that it is, since it works even when not connected. Is there a way to tell when the document is actually saved (callback)?

hba
  • 7,406
  • 10
  • 63
  • 105

1 Answers1

10

yep, it's async. You can use the 'error' parameter to see if there was an error during saving.

http://mongoosejs.com/docs/api.html#model_Model-save

tldr
  • 11,924
  • 15
  • 75
  • 120