WriteResult in mongoDB after update

How would one go about accessing the properties of this wrapper to check the status of a write operation from the client side that is running javascript to perform an update?

For example, I would like to perform an update operation on a mongoDB database using the update method and then check to see if the update was successful to move ahead with the rest of the code using WriteResult, both on the client side javascript code.

Any guidance is appreciated.

So, I found that the update method has been deprecated.

When using updateOne instead, an optional callback function can be included, and this function has to be given two arguments, where the second argument for the callback is the result object.

This callback function’s result object has a property called result, which is an object, and that has a property called ok.

If the updateOne operation was executed correctly, then the ok property is returned 1.

I’m guessing this applies to most other CRUD operations - I’m not sure what exceptions exist, but on checking delete and insert both had similar result objects being returned in the optional callback.