@avsej is spot on, you need to call .get() on the .add() method, because it is asynchronous.
So this code will work:
CouchbaseClient client = ....
client.add(key, document).get();
client.get(key); //returns null
@avsej is spot on, you need to call .get() on the .add() method, because it is asynchronous.
So this code will work:
CouchbaseClient client = ....
client.add(key, document).get();
client.get(key); //returns null