pymongo find project skip id code example
Example 1: mongodb select fields
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
Example 2: project mongodb c#
int count = 1;
await collection.Find(FilterDefinition<Student>.Empty)
.Project(x => new {x.FirstName, x.LastName})
.ForEachAsync(
student =>
{
Console.WriteLine($"{count}. \t FirstName: {student.FirstName} - LastName {student.LastName}");
count++;
});
Console.WriteLine();