MongoDB: Aggregation with $lookup

I am experimenting with the $lookup operator in mongoDB and I am stuck.

I created two collections in the db: states and counties.

State collection: 1 document
state: “Texas”,
abbrev: “TX”

County collection: 1 document
county: “Dallas”,
state_id: _id of Texas document in state collection

I am referencing the state in the county collection with the state’s id.

When I try to configure the $lookup in Compass no embedded documents show up.

But if I just enter ‘string’ for localField and foreignField, it shows the embedded document.

I’m confused. Can anyone shed light?

I don’t really know much about this but the doc examples has $lookup as key

Save you some click

db.orders.aggregate([
   {
     $lookup:
       {
         from: "inventory",
         localField: "item",
         foreignField: "sku",
         as: "inventory_docs"
       }
  }
])

Thanks! I will check this out.