I am trying my hands at MongoDB C# driver version 2.2. I am trying to use projection as I do not want to retrieve all the elements in the document. I found one way to do that is to use project operator along with find operator, something like this:
collection.Find(key => key.Index == 1).Project<MyClass>(Builders<MyClass>.Projection.Include(key => key.Name).Include(key => key.Index)). ToEnumerable ();
However I am interested in using AsQueryable API along with where operator, something like this:
collection.AsQueryable().Where(key => key.Index == 1);
Is it possible to use projection in above case? If I use select operator, will it have same effect as projection? Or will still fetch all the elements from database server and then select specified elements in the application server?