Hi
I was wondering if anyone could help me to render, as in ‘inspect’ an expression projection built using Builders.Projection.Expression. I have used the render function of a FilterDefinition and also ToJson and ToBsonDocument functions to inspect the ‘built’ filter, however, I was wanting to determine what the projection would be built as since it uses an expression with some LINQ components. When I run the Render function in returns RenderedProjectionDefinition, however, I would like to see the actual server side projection created. Is there a better or easier way to see the projection that is sent?
The projection in question is:
var projection = Builders<AdhocProductSchema>.Projection.Expression(e => new AdhocProductSchema
{
Fields = e.Fields.Where(f => f.Owners.Exists(filterParticipants.Contains)).ToList(),
Classifier = e.Classifier,
OwnerId = e.OwnerId,
Schema = e.Schema,
SchemaId = e.SchemaId,
SecurityId = e.SecurityId,
Version = e.Version,
Id = e.Id,
WorkspaceId = e.WorkspaceId,
Layout = e.Layout
});
The bit I am interested in is the Where statement on the Fields property. Is this executed client side?
Thanks
Craig.