I don’t see this documented elsewhere, so I thought I’d put something on the forum in case anybody else has this difficulty.
I was trying to use Mongoose’s docs to figure out how to use Model.create()
for “Create a Model” in “MongoDB and Mongoose” from the Back End curriculum, but the Mongoose docs didn’t make any sense. Every resource I can find says that it’s perfectly fine to call save()
without a callback function, but fCC keeps insisting that a callback function is necessary.
Turns out that Mongoose’s most recent major version is 8 (as of this post), but the fCC tutorial uses Mongoose version 5! Mongoose 5 does require (or at least accepts) callback functions when using save()
. Luckily, Mongoose still has docs for version 5, but it was still jarring/enlightening to discover that.
Hope this helps someone!