Introduction to MongoDb with .NET part 17: various query related functions
April 27, 2016 1 Comment
Introduction
In the previous post we started looking into the querying techniques exposed by the MongoDb .NET driver. We looked at two ways of building queries: filter definition builders and LINQ-style queries. Filter definition builders are more powerful in my experience, meaning that they offer more complex querying techniques than the LINQ-style version. We applied the filters to the Find extension method that can be attached to a Mongo collection represented by the IMongoCollection of T interface. There are other find-related methods in the driver, called FindSync and its awaitable counterpart FindAsync but I think the Find extension method is more flexible.
In this post we’ll look at various query-related functions that can be attached to our searches. They correspond to a number of functions we looked at earlier while working in the Mongo shell: counting, limiting, skipping and sorting.