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.
または 2 つの異なるフィールドで mongodb をクエリするにはどうすればよいですか。
たとえば{ fieldA : true }、 、または が必要{fieldB : true}です。それらのいずれかが機能します。
{ fieldA : true }
{fieldB : true}
演算子を使用し$orます:
$or
db.test.find({ $or: [{fieldA : true}, {fieldB : true}]})