Reputation: 146
I am using mongo3.0 with spring data I have question on the insert-async read that "mongodb inserts are asynchronous Mongo DB has asynchronous insert/update/remove operations. This means that when you issue an insert operation its a fire and forget operation where the database does not reply with the status of the insert operation."
Does this mean that the records are cached and mongo decides when to insert(physically write to disk) or the records are inserted instantly but there is no confirmation on the insert.
ref:-"https://mongodb.github.io/node-mongodb-native/api-articles/nodekoarticle1.html"
Upvotes: 5
Views: 9283
Reputation: 11152
Does this mean that the records are cached and mongo decides when to insert(physically write to disk) or the records are inserted instantly but there is no confirmation on the insert.
No caching involved. The record insert command is sent and there is no return value to know the status. It's a fire and forget: Send command, that's it.
However, as mentioned in another answer, you can use the write concern
option. There are different level that you can set:
You can read about it in the MongoDB documentation.
Upvotes: 2