I have a java couchbase client v2 that saves documents to database
JsonObject content = ...
JsonDocument newDocument = JsonDocument.create(key, expiration, content);
bucket.upsert(newDocument);
When content is null it saves a 'null-value' document that looks in the couchbase console like this
I'm migrating to couchbase java client v3 and save the document next way
JsonObject content = ...
var upsertOptions = UpsertOptions.upsertOptions();
if (expiration != null) {
upsertOptions.expiry(expiration);
}
bucket.defaultCollection().upsert(key, content, upsertOptions);
JsonDocument is not available in v3 and I put JsonObject directly and it works OK when content is not null.
When I have content as null like a previous case it throws an exception com.couchbase.client.core.error.InvalidArgumentException. If I try to use JsonObject.create() instead of null it creates an empty document but not 'null-value' document
Is it possible to create the same 'null-value' document with a client v3 for the sake of backward compatibility?

