📅  最后修改于: 2022-03-11 14:49:23.004000             🧑  作者: Mango
int count = 1;
await collection.Find(FilterDefinition.Empty)
.Project(x => new {x.FirstName, x.LastName})
.ForEachAsync(
student =>
{
Console.WriteLine($"{count}. \t FirstName: {student.FirstName} - LastName {student.LastName}");
count++;
});
Console.WriteLine();