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.
我想问一下当collection.deleteMany{()} 在java 中执行而没有任何查询或空字符串时会发生什么。它会无法执行(因为没有删除任何内容)还是会删除整个数据库?
当你在deleteMany()没有查询的情况下执行时,如果你想删除你可以使用的整个集合,它会返回错误deleteMany({})
deleteMany()
deleteMany({})