Java Client - Increment and Decrement Operations
I'm using the latest java client and trying to get a previously created counter (using the Increment and Decrement Operations)
the returned type from the get operation is String while I was expecting to have a Long value.
Am I missing something?
If this is a by design behavior - than I think that there is an inconsistency when comparing to other couchbase clients of other languages.
Can this be fixed?
too bad. it means that we cannot take advantage of the binary protocol. Java Strings are costly and using them for counters is (to say the least) not perfect at all.
I hope you guys can do something about it in the future. We're thinking about using Couchbase for realtime analytics but working with Strings in analytics is not what we had in mind.
It's mostly due to memcached legacy. Memcached values to be incremented and decremented must be strings, thus the client returns the same.
It may be slightly inconsistent w.r.t. other languages, but it's mostly designed to be compatible with existing code and libraries.