0
我有一个带有一些子文档的文档,其中每个子文档都有一个布尔字段。在所有mongodb子文档中切换布尔型字段
{
title: String
children: [{
exit: Boolean,
doc: String
}]
}
有没有一种简单的方法使一个DB调用切换为所有子文档的所有文件,所有的布尔?
据我所看到的,我可以做..
Model.find()
.then(function(items) {
// manipulate item.children and toggle the exit field.
// and save them one by one
})
但有一个更简单的方法?
确定那是什么我做到了。我想我必须这样做。 – user1017674
伟大的直觉:) – vdj4y
我真的在寻找一些方法来保存所有的父文件“原子” - 通过一个单一的mongodb调用。我想我不能。 – user1017674