Hi,
I’m struggling to figure out how to use Grapher to perform an aggregated find on an array of foreign keys.
For example, I can run this MongoDB query and get the result I expect:
db.getCollection('items').aggregate([
{
$lookup: {
from: "optionGroups",
localField: "options",
foreignField: "_id",
as: "optionChoices"
}
}
])
This returns this result:
The ‘optionChoices’ field at the bottom corresponds to the ‘options’ field that is highlighted. The actual document just has the ‘options’ property which is an Array of Strings containing the IDs of documents in another collection.
Can I perform this same query in Grapher? If so, how do I do that? I’m struggling to understand how I would do it.
I’ve tried to keep this initial explanation short but I can find provide more context on the schemas, links and queries if required.