Hi i just read about WriteConcern in MongoDB and want to apply in my code as well all i am doing is this
val mYdb = client("myDB")//get database Name
val collection = mYdb("directUser")//get collection Name
collection.drop()
val result:WriteResult= collection.insert(new BasicDBObject("_id",directuser.uuid)
.append("Email",directuser.email)
.append("SecondryEmail",directuser.secondryEmail)
.append("FirstName",directuser.firstName)
.append("LastName",directuser.lastName)
.append("UserStatus",directuser.userStatus.toString())
,WriteConcern.Acknowledged)
and from this link the deffination of
Acknowledged With a receipt acknowledged write concern, the mongod confirms that it received the write operation and applied the change to the in-memory view of data. Acknowledged write concern allows clients to catch network, duplicate key, and other errors.
how can i achieve the returned values and also want to get the confirmation
That it received the write operation and applied the change to the in-memory view of data.
how can i get to know that data is inserted successfully and no erros occured in insertion ..please help