Я пытался запустить MongoDB graphLookup, используя последний драйвер C #, который использует AggregateFluentExtensions .Согласно документации : метод получает серию параметров, которые я не могу найти способ заставить работать.
Кто-нибудь использовал это и мог бы помочь мне с примером?
Это json-версия моей агрегации:
db.getCollection("Item").aggregate(
[
{
"$project" : {
"itemMasterId" : 1.0,
"parentItemId" : 1.0
}
},
{
"$graphLookup" : {
"from" : "Item",
"startWith" : "$itemMasterId",
"connectFromField" : "itemMasterId",
"connectToField" : "parentItemId",
"as" : "ancestors",
"maxDepth" : 10,
"depthField" : "depthField",
"restrictSearchWithMatch" : {
"locationId" : 26
}
}
},
{
"$project" : {
"itemMasterId" : 1.0,
"parentItemId" : 1.0,
"children.itemMasterId" : 1,
"children.parentItemId" : 1
}
}
]
);
Спасибо!