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

Spatial views are proving to be tricky

2 replies [Last post]
  • Login or register to post comments
Tue, 01/08/2013 - 15:17
BruceH
Offline
Joined: 01/04/2013
Groups: None

Hi

For documents loaded from my GIS (here is a typical one):

{
"Last_Editor": "Brian",
"Creation_Date": "2012-12-15 12:22:57",
"ThoroughfareNumber": "45",
"Locality": "HALF MOON BAY",
"ThoroughfareTrailingType": "RD",
"Creator": "Tich",
"PostTown": "MANUKAU",
"ThoroughfareName": "PIGEON MOUNTAIN",
"AddressIdentifier": 214212,
"Shape": {
"type": "Point",
"coordinates": [
174.9000444190001,
-36.88651310299997
]
},
"Extent": {
"XMin": 174.9000444190001,
"YMin": -36.88651310299997,
"YMax": -36.88651310299997,
"XMax": 174.9000444190001
},
"PostalCode": "2012",
"LayerName": "DeliveryPoints",
"Last_Edit_Date": "2013-01-02 12:25:02"
}

...and a dev spatial view defined in Couchbase Console:

function (doc, meta) {
if (doc.Shape && doc.LayerName && doc.LayerName == 'DeliveryPoints') {
emit(doc.Shape, meta.id);
}
}

...I get no rows returned. Is there more to giving the system more hints on GeoJSON?

Thanks

Top
  • Login or register to post comments
Tue, 01/08/2013 - 15:38
BruceH
Offline
Joined: 01/04/2013
Groups: None

It came alive - so I think I'm OK - eventual consistency can be scary!

Top
  • Login or register to post comments
Wed, 01/09/2013 - 09:44
tgrall
Online
Joined: 09/05/2012
Groups: None

Hello Bruce,

Yes eventual consistency is alway surprising during development... so if you really need to have the latest persisted data you can use the Stale parameter when you call your view.

I am inviting you to read this part of the documentation: "Index Updates and the stale Parameter"
http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writi...

Regards

__________________

Tug
@tgrall

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