MongoDB projection field screening

Filter Syntax field

db.users.find({},{projection})

example:

db.users.find({user:"tom",time:{$gte:"20191111000000",$lte:"20191112000000"}},{name:1,_id:0})

Show only the name, does not show _id

Guess you like

Origin www.cnblogs.com/xibuhaohao/p/12157673.html