How to i am change this
var pp = from doc in collection.AsQueryable()
select doc.mainarray into nested
from nestedDoc in nested
where nestedDoc.sID == ssID
from dprg in nestedDoc.d.DArray
where dprg.ID == time
select dprg;
to samiliar to this
Builders<farray>.Filter.Eq(...............
My full code
var collection = MongoDB.GetCollection<farray>(MAINDB);
var pl = Builders<farray>.Update.Push("f1.$.f2.$.f3.$.f4", new Puts() { ID = new STX() {ID=people}, Type = type });
//var qq = from collection.AsQueryable();
var pp = from doc in collection.AsQueryable()
select doc.mainarray into nested
from nestedDoc in nested
where nestedDoc.sID == ssID
from dprg in nestedDoc.d.DArray
where dprg.ID == time
select dprg;
/*
var pupdate = from doc in collection.AsQueryable()
select doc.mainarray into nested
from nestedDoc in nested
where nestedDoc.sID == ssID
from dprg in nestedDoc.d.DArray
where dprg.ID == time
select dprg;
*/
collection.FindOneAndUpdate(pp,pl);
MongoDB Driver Version: v2.14.1
Coding Language: C#
I getting error on collection.FindOneAndUpdate(pp,pl);
CS0411 IMongoCollection<Program.farray>.FindOneAndUpdate<TProjection>(FilterDefinition<Program.farray>, UpdateDefinition<Program.farray>, FindOneAndUpdateOptions<Program.farray, TProjection>, CancellationToken)'...
I try this collection.FindOneAndUpdate(filter:pp,update:pl);
but nothing changed
farray is a class
pp variable is a IQueryable<DVMClass>
pl variable is a UpdateDefinition<farray>
I think i getting error because pp variable is not a FilterDefinition
If this error because this how to i change pp variable to a FilterDefinition