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

Views, Groups, and _count

No replies
  • Login or register to post comments
Wed, 01/30/2013 - 10:01
TimMeade
Offline
Joined: 01/27/2013
Groups: None

We are very new to couchbase 2.0, and if this is the wrong spot for this, please let me know.

Our issue seems to be a 'how to' on map reduce. After 2 days of reading and almost getting a solution, i've decided to post for the sake of saving some time.

Our JSON Relavant fileds.
{
"LASTREGISTRARCONNECT": "January, 30 2013 08:15:00-0500",
"PROXYIP": "192.168.5.119",
}

In an ideal world I would like to get back the count accesses grouped by the PROXIP fields that have connected in the last 10 minutes.

We have servers on 119-126 and about 40,000 accesses in the 10 minutes. I would like a count of which servers have been accessed.

Current Map function is:

function (doc) {
if(doc.PROXYIP && doc.LASTREGISTRARCONNECT) {
emit([doc.LASTREGISTRARCONNECT, doc.PROXYIP],
doc.PROXYIP, null);
}
}

If I do a _count in the reduce I seem to get the total If I pass in a firstkey of 10 minutes ago.

Any help here would be greatly appreciated.

Thanks

Tim

Top
  • 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