Searching across the internet how to retrieve a subset of fields in MongoDB, using C# official driver (but using LinQ as the base architecture) I found how to do this in Mon
This is cheating... but:
//This actual implementation is untested and may contain small errors.
//The helper method has been tested and *should* work.
public static IMongoQuery GetMongoQuery(this IQueryable query)
{
return ((MongoQueryable)query).GetMongoQuery();
}
var temp =
from x in DB.Foo.AsQueryable()
where x.SomeField > 5;
select (x.OtherField);
return temp.GetMongoQuery().ToJson();