Couchbase 2.0.1 Mapping of Plain Java String

Couchbase Enterprise / Community 2.0.1
Java SDK 1.1.5 / 1.1.7
client.add("myKey", "34.0");
The Couchbase console "Documents" view showed the value as "34". This case perplexes me. Why? Compare to another case below...
client.add("myKey", "6S.0");
The Couchbase console "Documents" view showed nothing, but drilling into the key showed the following (base64 encoded string)
"NlMuMA=="

So, I simply changed "." to "_" to get around the mapping "feature", but it still perplex me as to why Couchbase would convert the key value to aqn Integer when the key object is a String.

1 Answer

« Back to question.

Hello,

The short answer is, the Java sends a String to Couchbase server, the Server is storing "2.0" string.
BUT the Couchbase Administration Console interprets is as a JSON literal.

So it is a "Browser/WebConsole" bug, nothing bad with the database or SDK, you just need to be sure you do not modify the data from the console.

This is a known issue http://www.couchbase.com/issues/browse/MB-6450 (I have added some use cases as comments)

Regards
Tug
@tgrall