开发者

mongodb: emulating couchdb's incremental map reduce

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜