Details
Description
When using query projection, only 1/0 and true/false are valid for the values (plus null and undefined maybe):
> db.foo.find({ $text: { $search: "dog" } }, { foo: 1 })
|
> db.foo.find({ $text: { $search: "dog" } }, { foo: true, _id: 0 })
|
Other values should be disallowed, for example:
> db.foo.find({ $text: { $search: "dog" } }, { foo: "bar" })
|
> db.foo.find({ a:1}, { $foo: {} })
|
> db.foo.find({ $text: { $search: "dog" } }, { $meta: "textScore" })
|
Especially for text search, $meta: "textScore" can be very confusing.