3
My problem is this, I have an object:
public class Obj(){
prop int id {get; set;}
prop Client client {get; set;}
}
public class Client(){
prop int id {get; set;}
prop Group group {get; set;}
}
public class Group(){
prop int id {get; set;}
}
When performing the query, I would like to return only some object values:
var lRetorno = collection.Find(Query.And(query))
.SetFields(Fields<Obj>.Include(c => c.id, c => c.Client)
.Exclude(c => c.Client.Group))
There is a way to return obj Client
without mapping the object Group
, without changing the class mapping, including?
I’ve read all the documentation. If you look at it yourself, none of the examples show the actions on the second level of the object. And it is exactly my problem, after the first level. No failure occurs in the example of the post, it just doesn’t work. Returns everything e. =T
– Aline
I got it. I found this question in the stackoverflow (in English) the reply comments that the projections are made on the client (with LINQ). Are you using this? Since you do not have lists in your objects it is worth considering that it is not so expensive to search for your object with all dependencies, this is a document only in the bank?
– Jorge C. Bernhard Tautz
The consultations are done with lambda, and are very considerable consultations. In the post example I only used aggregated object but in the application there are many levels of objects and aggregated lists. Have you ever imagined consumption without need? = T
– Aline