With your aggregate command, I get the error:
Mon Aug 12 10:01:01.269 JavaScript execution failed: aggregate failed: { "errmsg" : "exception: bad query: BadValue unknown top level operator: $eq",
You shouldn't need $eq
, but instead do:
db.encounter.aggregate( [
{ "$unwind" : "$vitals" },
{ "$match" : { "vitals.spirometer.FVC" : "null" } },
{ $limit : 1 }
] )
$eq
is only used for in conditions.