How to update one by string field in mongo.

Ant6729

Well-known member
Joined
Jan 22, 2019
Messages
56
Programming Experience
Beginner
I have work logic:

C#:
            var result45 = await _unitOfWork.Deal.UpdateOneAsync(
                new BsonDocument("_id", "f9097a32-23a7-4242-b34d-1a6d54c17e14"),
                new BsonDocument("$set", new BsonDocument("totalSum", 9999)));

I have nowork logic:

C#:
            var result45 = await _unitOfWork.Deal.UpdateOneAsync(
                new BsonDocument("_id", dealId),
                new BsonDocument("$set", new BsonDocument("totalSum", 9999)));

I do not understand why.
Please, help.
 
What error code or exception are you getting?

What type is dealId?

What value is in dealId in the cases you are getting a failure?
 
Back
Top Bottom