-
Type: Task
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Hi Everyone,
This is my DB structure in Mongo, Now I want to delete the nested document based on the attributeValueId as shown above, I used this code in C# but it's not working
var filter = Builders<DimensionsDL>.Filter.Eq(item => item.Id, id);
var update = Builders<DimensionsDL>.Update.Pull("columns.$[].values", Builders<AttributeValueDL>.Filter.Eq(x => x.AttributeValueId, attributeValueId));
UpdateResult updateResult = _mongoCollection.UpdateOne(filter, update);
I am passing the _id and attributeValueId from UI,
I am getting the Matched count 1 in the result but ModifiedCount is 0, Please help me on this.