Tìm tất cả các document chỉ trừ document đặc biệt sử dụng $ne:

db.inventory.find( { quantity: { $ne: 20 } } )

Tìm tất cả các document trừ 1 số document đặc biệt theo mảng sử dụng $nin:

db.inventory.find( { quantity: { $nin: [20,22,25,'hight'] } } )

Tìm theo điều kiện:

db.inventory.find( { $where: "this.processStatus === this.gateStatus" } )

 

Leave a Reply

Your email address will not be published. Required fields are marked *