I started learning ASP.Net Core Web API development a few days back. For the same, I am following the official tutorial document by Microsoft.
However, there is an issue. A major one I guess. Since I am also new in MongoDB, I found that when running a particular code from the tutorial
the code section:
public void Update(string id, Book bookIn) =>
_books.ReplaceOne(book => book.Id == id, bookIn);
returns an error:
MongoDB.Driver.MongoCommandException: Command findAndModify failed: After applying the update, the (immutable) field ‘_id’ was found to have been altered to _id: null.
Do note, the code on Microsoft Site is exactly the same in my project.