On Fri, Dec 19, 2014 at 10:46 AM, Zach Rollyson <[email protected]> wrote:
> Comes from the line "menu.update({name:request.body.name}, menuObject,
> {upsert: true}, onUpdate)"
>
> It's because mongoose update takes three arguments: document, options,
> callback. You have object, object, options, callback; thus mongoose thinks
> your options object is the callback.
>
I nearly replied with a similar response, but then I realized the code is
actually calling Model#update
<http://mongoosejs.com/docs/api.html#model_Model.update>, not
Document#update
<http://mongoosejs.com/docs/api.html#document_Document-update>. The former
actually does take 4 arguments and from a cursory look it seems the calling
code is using it more or less correctly.
That said, I agree that changing this to Document#update is probably still
the correct solution.
~Ryan
--
http://twitter.com/rmgraham
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/CAGjmZGxdUVTr90zir73EWtK%3DJ52FrjerkzXN5VNK%2BexZUFBKag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.