couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Groves" <adam.gro...@gmail.com>
Subject View with incremental counter
Date Tue, 18 Nov 2008 12:27:35 GMT
Hi,

I've got the following view:

count = 0;
function(doc) {
  if(doc.type == "document") {
    count = count + 1
    emit(doc._id, count);
  }
}

The idea is that I get a list of documents, each having a counter
value which is incremental. I expected the count values to come out in
order, but that isn't the case: my first few documents have values of
62, 61, 22, 19. I'm not quite sure what's going on here - any ideas
how the order is being set here?

Regards

Adam Groves

Mime
View raw message