$expr and Computed Queries
$expr lets a query compare two fields of the same document or use aggregation expressions.
Example
db.items.find({ $expr: { $gt: ["$stock", "$minimum"] } })Exercise
Compare two fields.
{ $: { $gt: [...] } }
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.