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

Non-generic GetView with a view that uses a reduce function

3 replies [Last post]
  • Login or register to post comments
Thu, 05/31/2012 - 11:27
timd
Offline
Joined: 05/23/2012
Groups: None

Hi, I'm new to Couchbase and I'm having a little trouble using the non-generic GetView in the 1.2 .NET Library. I'm using the example Beer class shown here http://www.couchbase.com/develop/net/next, and my view function is:

function (doc) {
  if(doc.type == 'beer')
    {
       emit([doc.brewery, doc.name], null);
    }
}

With a _count reduce using group level 1.

And here is the code to get the view and iterate through it.

var view = client.GetView("beers", "by_brewery_and_name").GroupAt(1).Group(true);
 
foreach (var row in view)
{
   // do something
}

When I go to run the code it throws an unhandled exception:

Unhandled Exception: System.InvalidOperationException: The value 'id' was not found in the row definition. at Couchbase.CouchbaseView.__Row..ctor(CouchbaseView owner, IDictionary`2 row) in C:\dev\couchbase-net-client-build\src\Couchbase\CouchbaseView.cs:line 49 at Couchbase.CouchbaseView.b__0(JsonReader jr) in C:\dev\couchbase-net-client-build\src\Couchbase\CouchbaseView.cs:line 29 at Couchbase.CouchbaseViewBase`1.d__0`1.MoveNext() in C:\dev\couchbase-net-client-build\src\Couchbase\CouchbaseViewBase.cs:line 104

Am I doing something wrong? Or can you not iterate through an IView that uses a reduce function?

Top
  • Login or register to post comments
Fri, 06/08/2012 - 04:20
mcarcanague
Offline
Joined: 06/08/2012
Groups: None

Hi,

I am facing exactly the same problem.
Did you find a way to solve it?

Thanks in advance

Regards

Martin

Top
  • Login or register to post comments
Fri, 06/08/2012 - 09:12
timd
Offline
Joined: 05/23/2012
Groups: None

It's a bug in the .NET 1.2 preview. John's working on it. http://www.couchbase.com/issues/browse/NCBC-51

Top
  • Login or register to post comments
Fri, 12/14/2012 - 00:34
kumarishilpi
Offline
Joined: 12/14/2012
Groups: None

Hi All,

Actually i have an query on ,"How to pass parameter from front end by using GetView",Because wr are not going to do any hard coding in CouchDB so please help me to get the result.

var result = c.GetView("design Name", "View Name").Where("empName ="Amjkj000").AsQueryable();

it doesn't work ,

So if any body has getting this type of knowledge please revert me the code.

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