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

Composite key query in PHP SDK

2 replies [Last post]
  • Login or register to post comments
Wed, 12/26/2012 - 05:09
biswajit
Offline
Joined: 03/28/2012
Groups: None

Hi

I have a view which i have to query with keys. its happening from admin console but not with PHP SDK. Can you please tell me what am i doing wrong here? Code example...

Admin URL which is working
http://URL:PORT/bucket/_design/DDocument/_view/viewName?startkey=[2012,11]&endkey=[2012,12]&group=true&group_level=2&reduce=true&stale=update_after&connection_timeout=60000&limit=10&skip=0

But not with these php call

1. $couchbaseObject->view('DDocument','viewName',array('startkey'=>array('2012','11'),'endkey'=>array('2012','12'),'stale'=>'update_after','group'=>true,'group_level'=>2,'reduce'=>true));

2. $couchbaseObject->view('DDocument','viewName',array('startkey'=>'[2012,11]','endkey'=>'[2012,12]','stale'=>'update_after','group'=>true,'group_level'=>2,'reduce'=>true));

3. $couchbaseObject->view('DDocument','viewName',array('startkey'=>rawurlencode('[2012,11]'),'endkey'=>rawurlencode('[2012,12]'),'stale'=>'update_after','group'=>true,'group_level'=>2,'reduce'=>true));

Where i am doing wrong?

Top
  • Login or register to post comments
Sun, 03/10/2013 - 23:26
mpedhiwala
Offline
Joined: 03/08/2013
Groups: None

Hello,
did you ever figure this out ? I am running into a similar problem.

Top
  • Login or register to post comments
Mon, 03/11/2013 - 23:29
daschl
Offline
Joined: 05/19/2012
Groups: None

Can you please post the output of "$couchbaseObject-> viewGenQuery(....)" (same options as for view()). Then we'll see immediately whats the difference between those two requests!

Thanks

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