Calculating Stats on a Collection of Documents

@shusseina okay one thing upfront: it is not a good idea to interfere with the the sync gateway documents directly, see: http://developer.couchbase.com/mobile/develop/guides/sync-gateway/wcbs/bucket-shadowing/index.html

Also, the SDK does not add a timestamp of any means to your document, it’s up to you to add it (but it’s quite trivial anyways). The metadata does not contain that kind of information, all it contains is a TTL if you’ve set it, but no “created” or “modified” timestamp. Note that the sync GW and couchbase lite do things differently, but check the bucket shadowing from above for more info.