How can I search for the records filtering in a field that has an undefined value:
undefined
db.records.aggregate({ $match: {
If you have fields that exist but are undefined you can search for them with null.
db.records.aggregate({ $match: { myField: {$exists: true, $eq: null}, } })