我正在尝试检索一个" unwinded"我的文档版本,但结果超出了允许的最大大小。 这是我正在进行的聚合:
var result = collection.Aggregate(
new BsonDocument {{"$unwind", "$Surgeries"}},
new BsonDocument {{"$unwind", "$Surgeries.Procedures"}},
new BsonDocument {{"$unwind", "$Surgeries.Procedures.ScannedItems"}},
new BsonDocument
{
{
"$project", new BsonDocument
{
{"_id", 0},
{"PatientAgeId", 1},
{"PatientAge", 1},
{"PatientBMIId", 1},
{"PatientASAId", 1},
{"PatientASA", 1},
{"PatientBMI", 1},
{"ClientId", "$Surgeries.Procedures.ClientId"},
{"PhysicianId", "$Surgeries.Procedures.PhysicianId"},
{"ProcedureTypeName", "$Surgeries.Procedures.ProcedureTypeName"},
{"Item_CategoryName", "$Surgeries.Procedures.ScannedItems.CategoryName"},
{"Item_ManufacturerName", "$Surgeries.Procedures.ManufacturerName"},
{"Item_ItemClassName", "$Surgeries.Procedures.ScannedItems.ItemClassName"},
{"Item_ItemGroupName", "$Surgeries.Procedures.ScannedItems.ItemGroupName"},
{"Item_PriceTypeId", "$Surgeries.Procedures.ScannedItems.PriceTypeId"},
{"Item_Cost", "$Surgeries.Procedures.ScannedItems.ActualCost"}
}
}
});
是否可以使用GridFS来实现这一目标?
我已经读过可以使用$ skip运算符并使用多个聚合循环遍历集合并合并结果。这会如何影响性能?这是一个好习惯吗?