Views, Groups, and _count
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