Tag:nbsp operator pre post size rap f12 div space
MongoDB commonly used condition operators have $LT less than $gt greater than $lte less than or equal to $gte greater than or equal to $ne is not equal to $in in the judge is used to determine whether the element is inside the array $nin not in the judging element is not within the array $or or Judge &N Bsp; > Db.tianyc02.find () {"_id": ObjectId ("50ea6eba12729d90ce6e3423"), "name": "Xttt", "Age": 111} {"_id": O Bjectid ("50ea6eba12729d90ce6e3424"), "name": "Xttt", "Age": 222} {"_id": ObjectId ("50ea6b6f12729d90ce6e341b"), "name" : "Xtt", "Age":} {"_id": ObjectId ("50ea6b7312729d90ce6e341c"), "name": "Xtt", "Age":}> Db.tianyc02.find ({a ge:{$lt: +}}) {"_id": ObjectId ("50ea6b6f12729d90ce6e341b"), "name": "Xtt", "Age":} {"_id": ObjectId ("50ea6b731272 9d90ce6e341c ")," name ":" Xtt "," Age ":}> db.tianyc02.find ({age:{$lt: +, $gt:}}) {" _id ": ObjectId (" 50ea6b731272 9d90ce6e341c ")," name ":" Xtt "," Age ":}> db.tianyc02.find ({age:{$ne: one}}) {" _id ": ObjectId (" 50ea6eba12729d90ce6e 3423 ")," name ":" Xttt "," Age ": 111} {" _id ": ObjectId (" 50ea6eba12729d90ce6e3424 ")," name ":" Xttt "," Age ": 222} {" _id ": ObjectId (" 50ea6b7312729d90ce6e341c ")," name ":" Xtt "," Age ":} 2.2 $in & $nin > db.tianyc02.find () {" _id ": ObjectId (" 50ea6e ba12729d90ce6e3423 ")," name ":" Xttt "," Age ": 111} {" _id ": ObjectId (" 50ea6eba12729d90ce6e3424 ")," name ":" Xttt "," Age " : 222} {"_id": ObjectId ("50ea6b6f12729d90ce6e341b"), "name": "Xtt", "Age":} {"_id": ObjectId ("50EA6B7312729D90CE 6e341c ")," name ":" Xtt "," Age ":}> db.tianyc02.find ({age:{$in: [11,22]}}) {" _id ": ObjectId (" 50ea6b6f12729d90ce6e3 41b ")," name ":" Xtt "," Age ":} {" _id ": ObjectId (" 50ea6b7312729d90ce6e341c ")," name ":" Xtt "," Age ":}> Db.tia Nyc02.find ({age:{$nin: [11,22]}}) {"_id": ObjectId ("50ea6eba12729d90ce6e3423"), "name": "Xttt", "Age": 111} {"_id": Ob Jectid ("50ea6eba12729d90ce6e3424"), "name": "Xttt", "Age": 222} 2.3 $or > db.tianyc02.find ({$or: [{The Age : 11},{age:22}]}) {"_id": ObjectId ("50ea6b6f12729d90ce6e341b"), "name": "Xtt", "Age":} {"_id": ObjectId ("50ea6b7312 729d90ce6e341c ")," name ":" XTT "," Age ":}> db.tianyc02.find ({$or: [{age:11},{name: ' Xttt '}]}) {" _id ": ObjectId (" 50ea6eba12729d90ce6e3423 ")," Name ":" Xttt "," Age ": 111} {" _id ": ObjectId (" 50ea6eba12729d90ce6e3424 ")," name ":" Xttt "," Age ": 222} {" _id ": objec TId ("50ea6b6f12729d90ce6e341b"), "name": "Xtt", "Age": 11}
MongoDB conditional operator