getView() and getViews()


#1

Can you tell me which version of the client your using and also post the code that is causing the issue?


#2

Greetings all,
We are testing Couchbase 2.0 and are very impressed, but very very new to this. So please be a little patient please!
Using java libraries with ColdFusion actually.
Gets and sets are working great, so we are pretty sure we are getting the client properly.
We have written some views and via html seem to be working properly also.
BUT; using the beerView = myClient.getViews(‘beer’) from the sample data, returns nothing at all. No errors, just beerView is not even defined. Same when trying to get a particular view.
Looking at the methods in myClient and getView() and getViews are both there.
Am I missing something very simple here?
Much thanks.
Tim


#3

Hello,
Take a look to this sample code:
https://github.com/couchbaselabs/DeveloperDay/blob/master/Java/basic-ope

View view = cb.getView(“brewery”, “by_name”);
Query query = new Query();
query.setLimit(10);

            ViewResponse viewResponse = cb.query(view, query);
            for (ViewRow row : viewResponse) {
                System.out.println(row.getKey());
            }
You should use the client.getView() I am surprised that you see a getViews() in your client API, the only place I see a getViews is part of the designDocument API Regards