Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Java Client - Increment and Decrement Operations

2 replies [Last post]
  • Login or register to post comments
Sat, 10/06/2012 - 21:50
cb
Offline
Joined: 08/10/2012
Groups: None

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?

Top
  • Login or register to post comments
Sun, 10/07/2012 - 20:58
ingenthr
Offline
Joined: 03/16/2010
Groups:

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.

Top
  • Login or register to post comments
Sun, 10/07/2012 - 21:06
cb
Offline
Joined: 08/10/2012
Groups: None

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.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker