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

Query arguments in couchcocoa

1 reply [Last post]
  • Login or register to post comments
Wed, 10/26/2011 - 05:32
jeika
Offline
Joined: 10/26/2011
Groups: None

Hi, I'm setting up an app using geocouch and Couchbase Mobile iOS and testing this query example from https://github.com/couchbase/geocouch:
http://localhost:5984/places/_design/main/_spatial/points?bbox=-30,-60,110,15&plane_bounds=-180,-90,180,90

What is the best way to make this query from couchcocoa? There are methods like [CouchDesignDocument queryViewNamed:@""], but where would I put the bounding box parameters?

Thanks in advance.

Top
  • Login or register to post comments
Wed, 10/26/2011 - 10:18
jens
Offline
Joined: 10/04/2011
Groups: None

Good question. CouchCocoa doesn't have any support for GeoCouch yet, so there's no straightforward way to do it. You would either have to use the lower-level REST API to construct the query and parse the results, or modify CouchCocoa to add support for GeoCouch. (The second option would take less code but requires learning more about how CouchCocoa works.)

The main issues are that
(1) CouchDesignDocument can't generate query URLs with the "_spatial" path component, only "_view".
(2) CouchQuery doesn't have spatial attributes like "bbox" and "plane_bounds".
So probably the solution is to add a -spatialQueryNamed: method to CouchDesignDocument, and a CouchSpatialQuery subclass of CouchQuery with the required properties.

If you could file a bug report on this, it would be great, else I'll try to remember to do it. It's a feature I'd like to add, but I can't say when I'd be able to get to it; if you wanted to tackle it, I'd be glad to help out and incorporate your patch when it's ready.

--Jens

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