N1QL execute using QueryRequest, Document updating sometimes, not updating sometimes

The document is not updating every time, sometime is updating and sometime is not updating

public async Task<(bool isSuccess, string message)> DeleteQuestion(List ids)
{
var request = new QueryRequest()
.Statement($“UPDATE formsmanager AS FM SET FM.questions = ARRAY vs FOR vs IN FM.questions " +
“WHEN vs.id not in $ids END " +
“WHERE FM.type = $collectionType AND FM.contentType = $contentType”)
.AddNamedParameter(”$ids”, ids.ToArray())
.AddNamedParameter("$collectionType", nameof(questionDoc).ToLower());
var documents = await _repository.IBucket.QueryAsync(request);
return (documents.Success, documents.Message);
}

Did u set $contentType

Try the following query, when mutationCount is grater than 0 and documents are not updating check error. Also check query.log see any errors logged. MB-46802

UPDATE formsmanager AS FM
SET FM.questions = ARRAY vs FOR vs IN FM.questions  WHEN vs.id  NOT IN $ids END
WHERE FM.type = $collectionType AND FM.contentType = $contentType 
      AND ANY v IN FM.questions  SATISFIES  v IN $ids END