Closed grounzero closed 1 year ago
Can you post a minimal example of code that has this problem, your .NET version, your MongoDB driver version (if you specify one explicitly), your MongoDB version and your MongoFramework version?
If the code really is getting to the point of creating an UpdateOne model, that sounds like an obscure driver or database issue. Or maybe something else is special about your model you're trying to persist.
I'm trying to get a minimal example but atm cannot get a repro. Is it possible to specify a MongoDB driver version using the nuget package?
dotnet 7.0.9 MongoFramework 0.29.0 MongoDB.Driver 2.19.2.0 Mongo 4.4
I finally found the issue. It was updating a new object instance that had updated the _id
prop with a new Guid so it was never able to find the existing instance to update!
I'm having an issue updating documents. I can see in the profiler it is calling
UpdateOne
with the new values but they're not being persisted to the database.I've even tried removing and adding the item but it does not accept any changes and I am not sure what else I can try. Is there a way to get MongoFramework to use
ReplaceOne
instead or could it be something else?