开发者

mongodb: emulating couchdb's incremental map reduce

开发者 https://www.devze.com 2023-03-31 14:47 出处:网络
Are there any techniques for emulating couchdb\'s incremental MapReduce in Mongodb. Essentially, we want to a periodic map reduce to only touch new documents in a collection.

Are there any techniques for emulating couchdb's incremental MapReduce in Mongodb. Essentially, we want to a periodic map reduce to only touch new documents in a collection.

Could we use finalize to mark documents as 'old' and then filter开发者_StackOverflow社区 them out of the next map process?


Yes, there is support for incremental map reduce since MongoDB 1.8. See the writeup I did for examples: http://blog.evilmonkeylabs.com/2011/01/27/MongoDB-1_8-MapReduce/


I wrote a method that does this but avoids having to touch each source record, by using the timestamp encoded in the default ObjectId ids. See the gist:

https://gist.github.com/2233072

0

精彩评论

暂无评论...
验证码 换一张
取 消