【发布时间】:2012-10-24 07:40:22
【问题描述】:
有没有办法在 upsert 之后获取记录_id?
我看过这篇文章 (How to insert a doc into mongodb using mongoose and get the generated id?),但这只是针对插入,而不是更新。
此外,使用 MongoDB,您可以使用 getlasterror (https://groups.google.com/forum/?fromgroups=#!topic/mongoose-orm/ehZ11QY-OUw) 获取 _id,但 Mongoose 不提供对它的访问 (https://groups.google.com/forum/?fromgroups=#!topic/mongoose-orm/pSv6WrasvWg)
谢谢
【问题讨论】: