Skip to content

Instantly share code, notes, and snippets.

@johnlpage
Created March 4, 2022 13:14
Show Gist options
  • Save johnlpage/49338fe1d7dcea5004fbd8e36fff99bf to your computer and use it in GitHub Desktop.
Save johnlpage/49338fe1d7dcea5004fbd8e36fff99bf to your computer and use it in GitHub Desktop.
{
$let: {
vars: {
targetdoc: {
$max: {
$filter: {
input: "$location_lookup_targettemps",
cond: {
$gte: ["$$this.to", "$miltime"]
}
}
}
}
},
in: {
$subtract: ["$average", "$$targetdoc.target"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment