Either I'm missing something or is this a possible Node.js driver issue?
const users = await User.find({ 'test.test': { $gt: 0 } }).lean();
None of my User documents contain the test object, therefore none should meet this filter's criteria. However, instead of returning no documents, it's returning all of my user documents. According to the documentation, it should only ever return all of the documents in a collection if no/empty filters are passed?
Edit: I said ignoring filter as it only seems to occur when applying nested filters on undefined properties. For instance, if I add more filter conditions that a few documents meet they'll apply *correctly.
Example: User.find({ username: { $exists: true }, 'test.test': { $gt: 0 } }) returns only the user documents where username exists, however they still don't have the test object.