Skip to content

Instantly share code, notes, and snippets.

@jtemporal
Created September 26, 2022 22:31
Show Gist options
  • Save jtemporal/43336d966c612007b68bb304d6ccb9e9 to your computer and use it in GitHub Desktop.
Save jtemporal/43336d966c612007b68bb304d6ccb9e9 to your computer and use it in GitHub Desktop.
/**
* $lookup
* from: The target collection.
* localField: The local join field.
* foreignField: The target join field.
* as: The name for the results.
* pipeline: The pipeline to run on the joined collection.
* let: Optional variables to use in the pipeline field stages.
*/
{
from: "movies",
localField: "movie_id",
foreignField: "_id",
as: "movie_info"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment