I use mongoDB 3.0.1
in java application, I want to know how I can test the return value of DBCollection.insert(BasicDBObject)
,
For exemple, if the insert is done show message1
if not show message2
.
I see that mongoDB use WriteResult
as return and these's what I get when I print the WriteResult
WriteResult insert = dbCollection.insert(basicDBObject);
showMessageDialog(null,insert);
WriteResult{,n=0,updateOfExisting=false, upsertedld=null}