Question: Which projection shows only the FirstName and lastName fields of a document in the customers collection?
- `db.customers.find({}, {firstName: 1, lastName: 1})`
- `db.customers.find({}, {_id:0, firstName: 1, lastName: 1})`
- `db.customers.find({_id: 0, year: 1, maek: 1, model: 1})`
- `db.customers.find({}).project({firstName: 1, lastName: 1})`
Answer: The correct answer of the above question is Option B:`db.customers.find({}, {_id:0, firstName: 1, lastName: 1})`