In mongo(ose) what projection field values are treated as inclusion?

44 Views Asked by At

For an inclusive projection {type: 1}, I could replace 1 with NaN, "", "string", -1, which all work as an inclusive projection.

For an exclusive projection {type: 0}, I could replace 0 with false, null, undefined, which all work as an exclusive projection.

Is there documentation for the equivalent values?

I found this: https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/projection_parser.cpp#L117

But not sure if that is the corresponding function, since it doesn't include strings.

0

There are 0 best solutions below