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

Filter data, .net client

4 replies [Last post]
  • Login or register to post comments
Sun, 12/23/2012 - 09:06
retto
Offline
Joined: 12/23/2012
Groups: None

Hi,
I have a document with 3 million records, I created view and I want to filter data by some fields (e.g. between date or some other conditions), how I can do this?

If I use GetView("view", "view").Where(o => ...) it's returns all data from view and it's terrible for perfomance.

Regards, Alex

Top
  • Login or register to post comments
Mon, 12/24/2012 - 00:07
daschl
Offline
Joined: 05/19/2012
Groups: None

Hi, you can use view query param to limit your search:

Look here how you can do it with the .net sdk: http://www.couchbase.com/docs/couchbase-sdk-net-1.2/api-reference-view.html
and here is the general view reference: http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views.html

Thanks,
Michael

Top
  • Login or register to post comments
Tue, 12/25/2012 - 11:34
retto
Offline
Joined: 12/23/2012
Groups: None

but I can't find the way to filter by AND condition. Like in SQL key1='T' and key2='T2'?

Oh, I understood how to do.

Regards, Alex

Top
  • Login or register to post comments
Wed, 12/26/2012 - 04:56
tgrall
Offline
Joined: 09/05/2012
Groups: None

You cannot use 2 keys to filter in a view. The map function generates only 1 single key on which you can apply filter.

Based on your data model and views you may use Compound keys/criterion as documented here

http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writi...

Let me know if this is ok with your use case

Regards
Tug

__________________

Tug
@tgrall

Top
  • Login or register to post comments
Wed, 12/26/2012 - 05:21
retto
Offline
Joined: 12/23/2012
Groups: None

Yeh, I know.

I meant 1 compound key and yes - it's that I need.

Regards, Alex

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