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) ) )
ただし、更新されるアイテムは1つだけですが、一致するすべてのレコードを更新するにはどうすればよいですか?
助けてくれてありがとう、大いに感謝します:)
デフォルトでは、mongo は最初に見つかった行のみを更新します。一致する複数の行を更新するには、「multi」更新オプションを渡す必要があります。scala では、次のようになると思います。
Document.update( ("room" -> "test") ~ ("module" -> "item"), ("$set" -> ("active" -> 0)), Multi )