Gossip less
Find the product information----The price is less than 200 contains the product name, the goods number, the price, adds the information and so on
Db.goods.find ({"Shop_price": {$lt: $}},{"Shop_price":1,"Goods_name":1,"goods_id":1,"Add_time":1})
Items not classified as 3
Db.goods.find ({"cat_id": {$ne:3}},{"Shop_price":1,"Goods_name":1,"goods_id":1,"cat_id":1})
Items with a price below or equal to 400
Db.goods.find ({"Shop_price": {$lte: -}},{"Goods_name":1,"goods_id":1,"Shop_price":1,"cat_id":1})
To investigate goods with a price greater than or equal to 100, less than or equal to 500
Db.goods.find ({$and: [{"Shop_price": {$lte: -}},{"Shop_price": {$gte: -}}] },{"Goods_name":1,"goods_id":1,"Shop_price":1,"cat_id":1})
Query does not belong to column 3 and column 11 products with $and
db.goods.find ({$and: [{cat_id:{$ne: 3 }},{cat_id:{$ne: }}]},{ " Goods_name ": 1 , " goods_id ": 1 , " shop_price Span style= "COLOR: #800000" > ": 1 , " cat_id ": 1 })
Query does not belong to column 3 and column 11 products with $nin
Db.goods.find ({"cat_id": {$nin: [3, One]}},{"Goods_name":1,"goods_id":1,"Shop_price":1,"cat_id":1})
Query does not belong to column 3 and column 11 products with $nor
db.goods.find ({$nor: [{cat_id: 3 },{cat_id:11 Span style= "COLOR: #000000" >}]},{ " goods_ Name ": 1 , " goods_id ": 1 , " shop_price ": 1 , " cat_id ": 1 }
)
Remove items greater than 100 or less than 300 or less than 5000, greater than 4000
db.goods.find {$or: [{$and: [ {"Shop_price": {$lte: -}},{"Shop_price": {$gte: -}},]},{$and: [{"Shop_price": {$lt: the}},{"Shop_price": {$gt:4000}},]}]},{"Goods_name":1,"goods_id":1,"Shop_price":1,"cat_id":1})
Take out the item number 5 to find the remainder equals 1 of the record
Db.goods.find ({cat_id:{$mod: [5,1]}},{"goods_name" :1,"goods_id":1,"shop_price ":1,"cat_id":1})
Remove items classified as 3 or 11
Db.goods.find (
{"cat_id": {$in: [3,11]}},
{"goods_name": 1, "goods_id": 1, "Shop_price": 1, "cat_id": 1}
)
MongoDB Command---Pattern query statement