Problem:

How to use MongoDb 3 API to filter, sort, and project data? Unlike previous versions of Mongo, the new version there provides convenient API to work with data.

In previous versions of MongoDB we had to create queries by putting together Document tree, which was very inconvenient. This approach still does work, but Mongo 3 shipped with bunch of flexible classes to make it a lot easier: