Search code examples
c#mongodbazure-cosmosdb

Azure MongoDB Api Condition not supported


The following is my codes to remove documents:

    var filterAddInfo = builder.Lte("Claim_Date", branchEntity.Report_Date);
    mongoDB.BranchPerformance.FindOneAndUpdate(
     filterMain,
     Builders<BsonDocument>.Update.PullFilter("Add_Info", filterAddInfo));

It's working with MongoDB, but it's not working if I connect to Azure MongoDB Api. It prompt:

Command findAndModify failed: Operator ''OPERATOR_PULL' with condition' is not supported..

Seems like condition (Eg. lte is not supported in Azure MongoDB Api). May I know is there any alternative way to change my codes cater for this condition?


Solution

  • We do not yet support the pull operator with a condition specified.