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

Updating views with the Java API

2 replies [Last post]
  • Login or register to post comments
Mon, 07/16/2012 - 09:50
schom
Offline
Joined: 07/02/2012
Groups: None

I'm trying to update the Views in our Couchbase 2.0 server using the Java client library from http://www.couchbase.com/develop/java/next.

Using the normal set-operation with "_design/dev_user" as key returns successfully, but does not change the document in any way.

Using the delete and replace operations the request times out when waiting on the returned OperationFuture.

Is there some special protection for these documents rendering them unchangeable with the API, or am I doing something wrong?

Top
  • Login or register to post comments
Mon, 07/16/2012 - 10:54
wryder
Offline
Joined: 04/04/2012
Groups: None

Hey, this doesn't answer your question directly but thought I'd give you food for thought. I modify some views but found the easiest way was via rest. I do some of this from a coldfusion context which is java underneath...so this might make some really easy psuedocode for you:

http = new http();
http.setTimeOut( 3600 );

pageUrl = 'http://' & serverIp & ':8092/' & bucketName &'/_design/' & designName;
http.setMethod( "put" );
http.addParam( type="header", name="Content-Type", value="application/json" );
http.addParam( type="body", value=data );
http.setUrl( pageUrl );
result = http.send();

Where 'data' is the valid json describing the views, which you can see examples by doing something like:

pageUrl = 'http://' & serverIp & ':8092/' & bucketName &'/_design/' & designName & '?startkey="_design"&endkey="_design0"&includeDocs=true';

...anyhow the point is...you might look at using REST from your code if you find the java client isn't developed enough yet.

Top
  • Login or register to post comments
Sun, 07/22/2012 - 17:52
ingenthr
Offline
Joined: 03/16/2010
Groups:

Yes, the design documents need to be updated through the view REST interface. You'll find a simple example for how to do so on the wiki.  Also we're going to add some cluster management to the client, including management of design documents.

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