mongodb select fields
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
mongodb select fields
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
how to project specific field mongodb nodejs
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
//1 to show and 0 to hide
//_id always included need to be set to 0 if not needed
get custom fields in result of mongodb query
db.inventory.find( { age: "10" }, { _id: 0 , age: 1, user: { name: 1 } } )
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us