Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下
Document.update( ("room" -> "test") ~ ("module" -> "item"), ("$set" -> ("active" -> 0) ) )
但是只更新了一项,如何更新所有匹配的记录?
在此先感谢您的帮助,非常感谢:)
默认情况下,mongo 只更新它找到的第一行,要让它更新多个匹配的行,你需要传递“multi”更新选项。在 scala 中,我相信它看起来像这样:
Document.update( ("room" -> "test") ~ ("module" -> "item"), ("$set" -> ("active" -> 0)), Multi )