{"_id":"snapshot-reduce","_rev":"41-6993526fe6581e2b6b77330470863a23","name":"snapshot-reduce","description":"Incrementally reduce an event-log into a snapshot view of those events","dist-tags":{"latest":"3.0.1"},"versions":{"0.1.2":{"name":"snapshot-reduce","version":"0.1.2","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n        , \"timestamp\" : 1360877429848\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , \"timestamp\" : 1360878425642\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , timestamp: 1360877429848\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , timestamp: 1360878425642\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.1.2","dist":{"shasum":"fc285fe0a2a228a63846cb79e538a40c67f00f06","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.1.2.tgz","integrity":"sha512-iBNpAmzwTQBoFbjcAmQcrHsgelwoEO2/maaNDOutrYzhlfbJsWrfPWfUJ68xxkCbmohrUZ3FTQN33cCOQpX5yA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIARKS8k08HQj+znCT1FtlgW6T7dqWbvSOoVZ72KOlK/UAiEA3vPI7E7Dx9Ch9/PGuvU1st6ThKB/TnASNWFFtlMs0KA="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.1.3":{"name":"snapshot-reduce","version":"0.1.3","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n        , \"timestamp\" : 1360877429848\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , \"timestamp\" : 1360878425642\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , timestamp: 1360877429848\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , timestamp: 1360878425642\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , timestamp: Date.now()\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , timestamp: Date.now()\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n        , timestamp: someTimestamp\n    }\n}, {\n    eventType: \"add\"\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , timestamp: someTimestamp\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.1.3","dist":{"shasum":"6e11bef8cda681d9ac366de102535d8f1a3f75b2","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.1.3.tgz","integrity":"sha512-VkcaSLnU4Hwv01lDBUQ7r4TK7iTZ4IaPXcxRq9c6EEdvbDcbO0ihmw9tT0l0HqDwRxM1lsDh4kS/Jqz69+kmIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYv1/mDR51uCU/nYUUhhAKKGT/9K5MSgbiJ3bi/8vYwQIhAIsCkuNg0cqvRJVyjkHPmVUVSBTW4EU564oFpFssWmfg"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.2.1":{"name":"snapshot-reduce","version":"0.2.1","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.2.1","dist":{"shasum":"d5b691f5eb95c1ae1a3bd3e818fe0b9aac248d79","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.2.1.tgz","integrity":"sha512-3l/xGp90SaoDSEGh69koADUAKDzo0LPlznrtRLKbFXa9QxUH/d5EJZYlngO/dsb/VXscrN1s67ls0w70gZ4XoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZHboejvQozvJLsPZllQO4akV0M1Lt1HrhNahyU03JPAIgSTwBb2TP6w0+8o+oiy+dztnE5kcyUxT4+jBO8UwaG9U="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.2.2":{"name":"snapshot-reduce","version":"0.2.2","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.2.2","dist":{"shasum":"9cfebf13d4f59df3685440d5084661890f1f6f3f","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.2.2.tgz","integrity":"sha512-1vF0OgQWNnzIDnB4pIYlalO6754GBYHnhSUqzJZ726o3SGB8TeJXLsy8q2qftsFEvnp/P9rHWIaXziPPCO5DQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAyd7h5BO2onnuQQAX1QgN7FzQIBBCZEOWmck9HYlprUAiACiF834k826oZRpPa8TtTZuXnhA685u57348kBB6sN+w=="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.2.3":{"name":"snapshot-reduce","version":"0.2.3","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.2.3","dist":{"shasum":"348374b222b7d3d0aac12071de87893b812cdb64","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.2.3.tgz","integrity":"sha512-PsXnE5puLkIpaA8cOHqwn8JvKk36l0qThgG1cbmQrJ15C6Rzn/YrqM4aG9xkBh7gackVTbUNKv72huZsch5nKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApHgey8KY7RYFR/0e9KS1m7nFEwuUJKpsu9kTyg9txKAiEA7fs4l0xIddw4ZLhJNzZJnFnpAWBUQ0EdPI1SpMkR4D4="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.2.4":{"name":"snapshot-reduce","version":"0.2.4","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.2.4","dist":{"shasum":"7b5dcd2e593ad0f727dd64af244e55ae22883c9b","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.2.4.tgz","integrity":"sha512-u29osm061zssfFtg4HAFuW9A1ncsABJ9CIqVbMrIUyHbMZlJGQ2+0vYMwCGjUKohkquKPaacjXLfjIJgbwNgyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc33pxz8KwsVya1cGEL8QpOLNgKxjwGyvYqyYTKXlxlAIhAInT5WA6mGI5/7S7M2wLFe43PUW/GbHypvTxPLCaSswG"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.1":{"name":"snapshot-reduce","version":"0.3.1","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.1","dist":{"shasum":"b5ffc9267cc07b873c5b0268d5a02ace1c8d14d5","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.1.tgz","integrity":"sha512-7HV14hfGJf9hq5cQvE7OYkUlXKdeb8lu9Ikna8JFDz65UVI4ZSe0f7PA0dkScooJlP/mwMAwg1lM9WnXLNqCMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa6qwwkvtv/P7xeBmRubNGA8VQQLuVkD4E8/QovLXGaAiEAn4WNgLHDHOWw4pYzygXM/daj23W4P/6YXMfZC18ldkQ="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.2":{"name":"snapshot-reduce","version":"0.3.2","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.2","dist":{"shasum":"31d7a331afe9ce6f6bb1cbfe9c7ce77464201be5","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.2.tgz","integrity":"sha512-/NEP15EqJqXZ04EV3MmWiw4lh8t9M5qA/nnlJcdFO2dpIOGo7pNVgeXOHKUHUgkpHXHs1SZpQHXmBw7yA2U5Fg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDItsUyReW8ZKdBevJ9/0J71agG7vQy6PNM1KbRVGULmAIhAOV4IzDgzQ9so7WOqJRiFxbjQdIjDsyndysQubKuQAfT"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.3":{"name":"snapshot-reduce","version":"0.3.3","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.3","dist":{"shasum":"8e46039b0cc6b0a7613915f1bb74b81f36d674f6","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.3.tgz","integrity":"sha512-H5EdmyRngg745eTU5IDVtEOWCiqrZk4h6Pz85ThDQnoqp3w46UA3EhiOcvs5A485w0cC5mOYt52E520PgtjQ3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3D0jVIQj4vMqB7qjINSWh1YekCpySPrPitvZyNhpHNAiEAtkH5un79TmMrzPKyv92Z/gGihnU/pp549j9o8VJuj6g="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.4":{"name":"snapshot-reduce","version":"0.3.4","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.4","dist":{"shasum":"82441cbcd9567e82559158bb670c59c265224c20","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.4.tgz","integrity":"sha512-2EB/vtrO7nxbDwdvQVxAyDC48Uqr0DISuyzuLiYfLP+ks8ZNLz36hME1FEc/UWfUfm7MIpQIpj/JN0lt4q9UnQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt02dBZSybAyHgf/OeO46dvrK7SJ6cHZ5gXKm3WRXmCAIhAJ7ylR2Ezx9ZZ5VARQ3Y8anOwMPosHk8LPZWkm5iFDjZ"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.5":{"name":"snapshot-reduce","version":"0.3.5","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.5","dist":{"shasum":"9e537c234eec9546aea566f92fabe9285aced7f8","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.5.tgz","integrity":"sha512-nziM1zFWDlz9exvKTvM+Jmp7QMIzYeHiFOzDFcW8FPkASHATd57xOAkRx3m2DKtKHhxW1SuSIQ+5tu4/6b8UPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF8HPi7fgDzWUBCcOeKgK1qt2wk6B+2+GMxawIJ/pp5rAiByXtVp0Lb6lyy9O+vt2m86QMDAb9rKeveM46VfTi/r6w=="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.6":{"name":"snapshot-reduce","version":"0.3.6","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.6","dist":{"shasum":"96abdd036b5cb98c1576ddbbcb3cdd7b9fcea643","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.6.tgz","integrity":"sha512-t6t9gDEFbNI291Eyp5nWI7h5pPDUh4l21FDGSMYCTdUXB8kWVaAGILpzGKgc5WYVq7rhE4PR61N0luxPvm+Wig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbupVg14lg/RMaOaHAz7cKuKyvt4iX6uu20GoqurEwQgIhAIosrvKnMXEGza1wbR94Q0QcThEN0Wt/LARwsTkMTgFj"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.7":{"name":"snapshot-reduce","version":"0.3.7","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.7","dist":{"shasum":"293c4d16b317317cd9d7f0952be97d4914b1c59f","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.7.tgz","integrity":"sha512-BvkTJpYDU9n/fl0mCiVPAJjGRnrFupJ02jMf9WMSBeC+OlwzXv2uF3kJWtWQd7JdoxQ5zNSOdWIjb2xGYrk83Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpiTekTuBsUu2HcTij1FnuCi/Tz/7KAAy0ugQOV7lqXAIhAM7u3YeORsRDg+JWJCPZuCr7d5pMMrKScgeidRhBrY+4"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.8":{"name":"snapshot-reduce","version":"0.3.8","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.8","dist":{"shasum":"9a93474a2df77ead7fe5e6f39f883cbb57d3f70b","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.8.tgz","integrity":"sha512-ui1RQsd+F780kFneG4iAE8vDrUsBOB0+o6BuIVkl2tcEnh8CePVNnoCeGePdikvREm6klJkpSdHVYW9geVZ3nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/2Tbk1CYzwXw0Wp9sUhnX6UgJOhvQq1Zdspzh8UYABAiBFlJNsUPpC/trOCmplS/IGSF+McFXreV/Oz47244Hbcg=="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"0.3.9":{"name":"snapshot-reduce","version":"0.3.9","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~0.1.2","reducers":"git://github.com/Raynos/reducers"},"peerDependencies":{"reducible":"Raynos/reducible#1.x"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","testem":"~0.2.56","reducible":"~1.0.5","mongo-client":"~0.1.5","reducers":"git://github.com/Raynos/reducers","callback-reduce":"git://github.com/Raynos/callback-reduce","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","introspect-reduce":"~0.1.2"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@0.3.9","dist":{"shasum":"4a7295a228c295cd4d26eb5f68b1d8fcbd05f815","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-0.3.9.tgz","integrity":"sha512-kUgPDkTfGJKYzCy4dNZnj13qO3u3l5MNYDAeSx57cZd81HIZEgiNDl2qcfVwmYjVTCgCKQTv9vUx2JHuA2kbWg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiDoJVMa2b2yHwuu5d25euxoHXCDCtltTJ4dL9uzXIAwIgKsW0qSciPkF1l62/8sPCdoa1ZcEOzz39DQu04ZxUdyM="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"1.0.1":{"name":"snapshot-reduce","version":"1.0.1","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~1.0.1","reducers":"Raynos/reducers#dedup","reducible":"Raynos/reducible#v1.0.6"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","mongo-client":"~0.2.1","callback-reduce":"Raynos/callback-reduce#dedup","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@1.0.1","dist":{"shasum":"a317fc652035bdbb06f1bc531a4cb0979686b2df","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-1.0.1.tgz","integrity":"sha512-7Qq91Sk7vfry5bshHSzY7vRRz6Y0MWbzrJuDU4UCFg1Wc6YK069qqmNeviYUxUryArLwWEUlAbpyDEq9aHsV4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCst1Fq3Tolrxosy7TQJJz4sPeFxFyK8TzPxeVXOKj5HwIgFCc33QWo7FdfE4tW38F7ps8zjhhkXD+9bbNR6gHrVVA="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"1.0.2":{"name":"snapshot-reduce","version":"1.0.2","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~1.0.2","reducers":"Raynos/reducers#dedup","reducible":"Raynos/reducible#v1.0.6"},"devDependencies":{"tape":"~0.2.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","mongo-client":"~0.2.1","callback-reduce":"Raynos/callback-reduce#dedup","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@1.0.2","dist":{"shasum":"679a2e3846a883710c091c8f2df041caffbb5e22","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-1.0.2.tgz","integrity":"sha512-6CGl6Cqzjc+/DFj7o5aODwI2vAN4DdNwlO9zSywRQAqI+gAwBjebOMG0C7+Y2B/FdAOM6D3NR7+OFu/ImgdpEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLgq9OyA1K6riHIoG2B0bMVHOlUPMPipT/XRUeNfEvyQIhAJGbRMcI1Kpe0v5UfHh4symgnKg79rjTaPrg/6ZvhHeU"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"2.0.1":{"name":"snapshot-reduce","version":"2.0.1","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~1.0.2","reducers":"Raynos/reducers#dedup","reducible":"Raynos/reducible#v1.0.6"},"devDependencies":{"tape":"git://github.com/Raynos/tape","browserify":"https://github.com/raynos/node-browserify/tarball/master","mongo-client":"~0.2.1","callback-reduce":"Raynos/callback-reduce#dedup","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@2.0.1","dist":{"shasum":"1644b779d15da688a845c9db93040d7ad1815d8f","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-2.0.1.tgz","integrity":"sha512-drysqfneljDsOUP2+0xfLxvWnZaoXa1cecQTXN4xAKjTcSOCRHqXJc6pkbAGwGNse67wW2aNLknNgUDNYQmguw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0p1LhUDHiQqRKII5GqzEfGbY2KxSsXfiG0Yv8byAJLAiB/1MNJlYz/AzY63Iffc1mjCd0LkgPZ4zKqdi88cuXCFw=="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]},"3.0.1":{"name":"snapshot-reduce","version":"3.0.1","description":"Incrementally reduce an event-log into a snapshot view of those events","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"},"main":"index","homepage":"https://github.com/Colingo/snapshot-reduce","contributors":[{"name":"Raynos"}],"bugs":{"url":"https://github.com/Colingo/snapshot-reduce/issues","email":"raynos2@gmail.com"},"dependencies":{"incremental-map-reduce":"~2.0.1"},"devDependencies":{"tape":"~1.0.2","browserify":"https://github.com/raynos/node-browserify/tarball/master","node-uuid":"~1.4.0","after":"~0.6.0","monotonic-timestamp":"0.0.8","xtend":"~2.0.3","continuable-mongo":"~0.1.6"},"licenses":[{"type":"MIT","url":"http://github.com/Colingo/snapshot-reduce/raw/master/LICENSE"}],"scripts":{"test":"node ./test","build":"browserify test/index.js -o test/static/bundle.js","testem":"testem"},"testling":{"files":"test/index.js","browsers":{"ie":["8","9","10"],"firefox":["16","17","nightly"],"chrome":["22","23","canary"],"opera":["12","next"],"safari":["5.1"]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360877429848\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"timestamp\" : 1360878425642\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n### Unpacking snapshots.\n\nYou can also do the reverse, turn a snapshot into the minimal\n    amount of raw events needed to construct that snapshot\n\n```js\nvar unpackSnapshot = require(\"snapshot-reduce/unpack\")\nvar assert = require(\"assert\")\nvar into = require(\"reducers/into\")\n\nvar list = unpackSnapshot({\n    id: \"1\"\n    , type: \"x\"\n    , foos: [{\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }]\n})\n\nassert.deepEqual(into(list), [{\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"1\"\n        , type: \"x\"\n    }\n}, {\n    eventType: \"add\"\n    , timestamp: 0\n    , value: {\n        id: \"2\"\n        , type: \"x~foos\"\n        , parentId: [\"1\"]\n    }\n}])\n```\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","readmeFilename":"README.md","_id":"snapshot-reduce@3.0.1","dist":{"shasum":"42952de2680fb008c8fe7c0560bc976378c9ece5","tarball":"https://registry.npmjs.org/snapshot-reduce/-/snapshot-reduce-3.0.1.tgz","integrity":"sha512-NwaEQfezo2fmnjg0eiJOlwOF9Nu+d3HldlGM6dKBCZ0PDWOqNrXStQyt0AO7Twnp3DLkU8kOyvEZ5YtxhCoZ1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJmNj+lbCM0dQ8a2SiOgt4qiaWQfvwx3xoJFoYSrUqkAiBCLFdcf7z9UHFBDMZIRiarQQhI2T2IjL73p4riaZz/7A=="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}]}},"readme":"# snapshot-reduce\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n<!-- [![browser support][5]][6] -->\n\nIncrementally reduce an event-log into a snapshot view of those events\n\nThe idea is that you store all your raw data as a massive log of\nappend only events, i.e. you never update or delete anything.\n\nThen you use snapshot-reduce to reduce the event log into a\n    coherent snapshot of a subset of current state.\n\n## Example\n\nSnapshot reduce allows you to accumulate a subset of a event log\n    into a snapshot representation of that data. The actual\n    mapReduce is based on mongoDB and is incremental.\n\n```js\nvar snapshotReduce = require(\"snapshot-reduce\")\nvar passback = require(\"callback-reduce/passback\")\n\n// Get a mongoDB instance however you want\nvar db = someMongoDb\nvar inputCollection = db.collection(\"event-log\")\nvar outputCollection = db.collection(\"snapshot.my-thing\")\n\nvar command = snapshotReduce(\"my-thing\", {\n    inputCollection: inputCollection\n    , outputCollection: outputCollection\n})\n\npassback(command, function (err, res) {\n\n})\n```\n\nFor this to work you must adhere to some constraints of the\n    event-log input. For example if your input is:\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"value\" : {\n        \"title\" : \"some room\"\n        , \"type\" : \"colingo-room\"\n        , \"id\" : \"1\"\n        , \"timestamp\" : 1360877429848\n    }\n}\n```\n\nThis is a message that says \"a room was added\". You may have\n    another message like\n\n```js\n{\n    \"eventType\" : \"add\"\n    , \"value\" : {\n        \"name\" : \"Jake\"\n        , \"message\" : \"test\"\n        , \"type\" : \"colingo-room~messages\"\n        , \"parentId\" : [ \"1\" ]\n        , \"id\" : \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , \"timestamp\" : 1360878425642\n    }\n}\n```\n\nWhich says a message was added to a room. The room it was added\n    to was the room with id `\"1\"`\n\nAll inputs should have inline `type`, `id` and `timestamp` fields.\n    The `type` is used to query a subset of the event-log to\n    map reduce. The `timestamp` field is used to support\n    incremental map reduce, i.e. it will only reduce values that\n    have a timestamp higher then the last one from last time.\n\nThe two events above would be reduced to\n\n```js\n{\n    title: \"some room\"\n    , id: \"1\"\n    , type: \"colingo-room\"\n    , timestamp: 1360877429848\n    , messages: [{\n        name: \"Jake\"\n        , message: \"test\"\n        , id: \"3dedc0cc-917b-48ed-a3c9-6166011fb458\"\n        , timestamp: 1360878425642\n        , type: \"colingo-room~messages\"\n        , parentId: [\"1\"]\n    }]\n    , __lastTimestamp__: 1360878425642\n}\n```\n\nThe `__lastTimestamp__` field is used to do an incremental map\n    reduce and basically allows snapshot-reduce to reduce the\n    entire history of the event log again.\n\n## Installation\n\n`npm install snapshot-reduce`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Colingo/snapshot-reduce.png\n  [2]: http://travis-ci.org/Colingo/snapshot-reduce\n  [3]: http://david-dm.org/Colingo/snapshot-reduce/status.png\n  [4]: http://david-dm.org/Colingo/snapshot-reduce\n  [5]: http://ci.testling.com/Colingo/snapshot-reduce.png\n  [6]: http://ci.testling.com/Colingo/snapshot-reduce\n","maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}],"time":{"modified":"2022-06-26T21:40:30.070Z","created":"2013-02-15T21:08:43.073Z","0.1.2":"2013-02-15T21:08:45.952Z","0.1.3":"2013-02-15T21:53:44.607Z","0.2.1":"2013-03-01T02:32:28.224Z","0.2.2":"2013-03-01T03:11:28.047Z","0.2.3":"2013-03-01T03:20:13.352Z","0.2.4":"2013-03-01T03:29:00.014Z","0.3.1":"2013-03-06T03:27:42.041Z","0.3.2":"2013-03-06T04:27:31.876Z","0.3.3":"2013-03-06T18:30:08.296Z","0.3.4":"2013-03-07T00:36:03.556Z","0.3.5":"2013-03-08T20:06:18.567Z","0.3.6":"2013-03-08T23:15:58.955Z","0.3.7":"2013-03-08T23:48:25.037Z","0.3.8":"2013-03-19T02:29:37.276Z","0.3.9":"2013-03-25T20:15:28.891Z","1.0.1":"2013-04-11T00:34:47.651Z","1.0.2":"2013-04-30T01:09:45.038Z","2.0.1":"2013-05-09T01:17:58.393Z","3.0.1":"2013-05-09T21:10:57.102Z"},"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Colingo/snapshot-reduce.git"}}