db.products.find({$text: {$search: "IBM"}}, {score: {$meta: "textScore"}}, {pictures: 0});
Hi Marco,
find() command has the following form:
db.collection.find(query, projection)
The score
and $meta part in your $text search query, is the projection section of find()
. Therefore, you could just add the exclusion of pictures
field in the same section. For example:
db.products.find(
{$text: {$search: "IBM"}},
{score: {$meta: "textScore"}, pictures: 0}
)
Regards,
Pooja