Reputation: 478
I am trying to create a deleteAll method in mongo where I could delete multiple records in one go bu supplying the method a list of object ids to be deleted something like this
protected virtual DeleteResult DeleteAll(List<ObjectId> listId, WriteConcern concern = null)
{
return MongoCollection
.DeleteManyAsync(ItemWithListOfId(listId))
.Result;
}
protected FilterDefinition<T> ItemWithListOfId(List<ObjectId> id)
{
return Builders<T>.Filter.Eq("_id", id);
}
it is giving no error but is not deleting any record as well. Anyone any help?
Upvotes: 7
Views: 7433