Is there any way to implement a slice along with a projection in just one query using the c# driver? Below is what i am trying to achieve using c#, but im stuck, can anyone help
There is a way to do this with the C# driver. Methods can be chanined on builders, so all of .Slice() and .Include()and .Exclude()
.Slice()
.Include()
.Exclude()
var fields = Fields.Slice("empActivity", -1) .Include("employeeId", "empActivity.transId") .Exclude("_id"); var cursor = collection.Find(query).SetFields(fields);