.Net Client GetView not working


#1

Hello All,

I am running couchbase on windows 7 and have created my first view. The details are as follows:

Map Function:

function (doc, meta) { if (doc.type && doc.type == "UserWebsiteProperties" && doc.keywords) { emit(doc.url, null); } }

When I query the view through the REST API I get the expected results:

{“total_rows”:2,“rows”:[
{“id”:“stephen”,“key”:“http://google.com”,“value”:null},
{“id”:“stephen1”,“key”:“http://www.yahoo.com”,“value”:null}
]
}

However, when I try and query the view through the .Net library I keep getting the following error(this is in a WCF service):

var view = client.GetView("_design/keywords", "keywords");

Message: Query failed for view keywords in design document _design/keywords

Reason: attachments not supported in Couchbase

Stacktrace: at Couchbase.CouchbaseViewHandler.d__0`1.MoveNext()
at SEOServices.Service1.GetAllKeywords() in c:\Users\Stephen\Desktop\SEO\Services\SEO Services\SEOServices\Service1.svc.cs:line 32
at SyncInvokeGetAllKeywords(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

Please not that adding and getting documents all works as expected. This is really driving my crazy so ANY help would be greatly appreciated. And I am not trying to use any attachments in any way whatsoever.

Thank you kindly,
Stephen


#2

sglazer-

That is a bug which will be fixed in 1.3.5 to be released first week of May. Here are more details: http://stackoverflow.com/questions/23080118/view-query-returns-count-but-not-rows

Note that if you call the overload with urlencode=true you will be up and running: client.GetView(“designdoc”, “view”, true);

Thanks,

Jeff


#3

Thank you very much for the quick response however it seems my issue is different as the one posted seem to return a count whereas mine errors out on that line. I also did try and set the third parameter(urlencode to true) to no avail. Any other suggestions? Waiting until May is very problematic for me.

Stephen


#4

sglazer-

Your right, I didn’t read your question very well; my apologies :frowning:

This is actually something I haven’t seen yet, but this Q&A seems to be similar: http://www.couchbase.com/communities/q-and-a/errorbadrequestreasonattachments-not-supported-couchbase

If you can post an example with a couple of documents in a jira ticket: http://www.couchbase.com/issues/browse/NCBC.

I’ll debug through it and see what’s going on.

Thanks,

Jeff


#5

Do you think using another version of the SDK might help? I am currently using version 1.3.4 I am trying to advocate using Couchbase for some production sites at work and telling them we have to wait to weeks because I can’t even query a simple view to work will not bode well my my chances of convincing my colleagues to give it a try.

Stephen


#6

Thanks Jeff. I will post all the information to Jira. Thanks again for the help!

Stephen


#7

I have submitted the ticket Jeff. If you have any questions or need any more information please let me know.

Thanks,
Stephen


#8

The problem is here:

var view = client.GetView("_design/keywords", “keywords”);

Remove the “_design” and the query will work:

var view = client.GetView(“keywords”, “keywords”);

Thanks,

Jeff


#9

Thanks Jeff. It worked liked a charm :slight_smile:

Stephen