在流星中使用Mongoose的Findoneandupdate 我的流星应用程序有一个很大的问题。我需要在流星应用中使用findoneandupdate函数。我阅读了文档,但我不了解太多,我们能帮我吗?

问题描述 投票:0回答:1
Tasks.update(this._id, { $set: { checked: ! this.checked }, }); MyObject.update({findbyID or another variable}, {$set: {do the update}}); MyObject.update({id: objecid, private: true}, {$set: {private:false}});

meteor mongoose
1个回答
0
投票
对于像我这样的其他晚期到达:在这种情况下,您可以做

[YourCollection].rawCollection().findOneAndUpdate

访问mongo node.js驱动程序的本机方法。
	
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.