I tried finding solution for this online, but no success.
This is the code:
Invoice.count( { $expr: {$gt: [ "$totalAmount", "$remainingDebt" ]} } ).exec(callback);
where totalAmount
and remainingDebt
are fields in schema Invoice.
The result I get is: "unknown top level operator $expr".
I am using mongoose 5.0.11 and mongo lab.
Any ideas?