{"_id":"@baethon/mongoose-lazy-migration","_rev":"5-831e940a0aacca6f64bdb6b52fe9932c","name":"@baethon/mongoose-lazy-migration","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@baethon/mongoose-lazy-migration","version":"1.0.0","description":"Migrate Mongo documents on-load","main":"src/index.js","author":{"name":"Radoslaw Mejer","email":"radmen@baethon.com"},"license":"MIT","scripts":{"test":"ava","lint":"xo","lint:fix":"xo --fix"},"dependencies":{"@baethon/pure-mutation":"^1.0.0"},"devDependencies":{"ava":"^2.4.0","husky":"^3.1.0","lint-staged":"^10.0.0-beta.15","mongoose":"^5.8.3","xo":"^0.25.3"},"peerDependencies":{"mongoose":"^5.6.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix"]},"gitHead":"95fb3b77241c877a0c288fed6d57950aabedf6c9","_id":"@baethon/mongoose-lazy-migration@1.0.0","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"integrity":"sha512-5C7sKjhfwmvjS3K6eJ+xE2aUG5Y7PSIHL3M4lDaV5hUcU0kdq5b9TiZu5pQrPEh7E4yfcDOP4h+Py5YTDJkg2w==","shasum":"c282940d08ea482bed8be7a2a0af733bb6b59c51","tarball":"https://registry.npmjs.org/@baethon/mongoose-lazy-migration/-/mongoose-lazy-migration-1.0.0.tgz","fileCount":10,"unpackedSize":8655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFlHHCRA9TVsSAnZWagAAabcP/A1yqnMx8YNb4f8XlL0D\nCkqVh4LzDlAN0QZZdmvWA82YkTJFM5QBy8FgozLFl7msyG/u/ZOT/DTIyXps\n39mxvLEUsBWh1yvjXjwmzARG8Xja2uHpr5DrbxFsmiBDYDuZSKScRUPIffui\nEA64SiqYn+xoiG9lIlqaZpIz+boN5r2g5pIHCctc2GnE2uMMs9OhpBXRCBpy\nrWJSSTKLiLtndqldNssaQOWdHG29Bt0f7DOFuVaZ8R8J5yPsnaz2G9YnsH/o\nLHLkuhkdzW7gq25a/uLNhMxzRejIkQOMvlFZuusbXyTDaLXNu/E1VJu7/blt\nYF8GFYsFNBDMid/arPH3oQqqcFUy16s7WM0ek8yWRVpiOs5XtT94ARPs16vV\n7gbUE5uTwRzkF3yT5DV3NAJcac0Qp0m2Rx9x3tElOHZ1dFqvgPYKbF2qzVyP\nWKROZYE38zbnwRYoK6CqPiS+h7xcP7JYHSghPUmPPIaRg8jFECrrIDWH2s9a\n5xiaBujQrZt0NeTFvvpDUcd24FFe1F5SkPndDCfwEDEeSr6nfI9ncDY0UK5S\nxaGMQxE3A/lbGs4JZ4HIU9xMO2IxU37pjCZNdG8bnydOp+/tsQj00lRTQUXJ\n1rfjgNvxN0PC/Tu39Fga5D5DzXwplJbsGtSTwico0tnuUFF+O7XBobJp6ugX\n6WZa\r\n=fhUU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6ukyHFMIKrH8wuGOorCo/DMB/XSZpOvNITCy+j1SA2AiA3DpBRW3UwGaLBrd1TiJqEFfHz8R7GlG51KE1gb8tz6A=="}]},"maintainers":[{"name":"radmen","email":"radmen+npmjs@gmail.com"}],"_npmUser":{"name":"radmen","email":"radmen+npmjs@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoose-lazy-migration_1.0.0_1578521030649_0.678465728886239"},"_hasShrinkwrap":false},"1.0.1":{"name":"@baethon/mongoose-lazy-migration","version":"1.0.1","description":"Migrate Mongo documents on-load","main":"src/index.js","author":{"name":"Radoslaw Mejer","email":"radmen@baethon.com"},"license":"MIT","scripts":{"test":"ava","lint":"xo","lint:fix":"xo --fix"},"dependencies":{"@baethon/pure-mutation":"^1.0.0"},"devDependencies":{"ava":"^2.4.0","husky":"^3.1.0","lint-staged":"^10.0.0-beta.15","mongoose":"^5.8.3","xo":"^0.25.3"},"peerDependencies":{"mongoose":"^5.6.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix"]},"gitHead":"cfa41f47f5df1ae0e83e0cec93d6205ea514362c","_id":"@baethon/mongoose-lazy-migration@1.0.1","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"integrity":"sha512-QL/6nKF/HnrXECu3GgbXmYXE2GhD39saEv/cguUAhAKUsPHQKpAs26A2uVj0QE9kiWHvqAA1gVV039s2V+O2JA==","shasum":"bb9c62c96c2cc73eb7bbdaca15bed57665dee602","tarball":"https://registry.npmjs.org/@baethon/mongoose-lazy-migration/-/mongoose-lazy-migration-1.0.1.tgz","fileCount":4,"unpackedSize":5287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFlMNCRA9TVsSAnZWagAAe9wP/1/VECDOTFDA1N+NeTsx\nxSvFNk24RlvprEdHj2h26q+nwEZlH2Kyxmq+c/bRb4KTioITjjUdya8FgDja\naRE7XCqhM2Ogi7OWC1/fDPAmSpn3OAn3Fjx+8edwZxBPf/Bd4GZKbUSbAjvX\n6c4+WSjCDRi0rRC65cioamjYVOUj0wyzWyFKFjTS1YGST1v9wgvaOZFWeGTy\nAnEDja9p4zz+Qk6ryAWxV5VRjxAZAHqwZbcLN4Teu7fiu19RCxc2i2fDpnvv\ndCmwzOQc6WkDezIUNPmXcLpxGWvS6DV8cyW9zX/Jee9wLQFGyvEA1yJtqb5r\ngPuZzEYqfCSsg5GeljguKn6c7Vg2wjoz3Kaw71WYbxrvtFecdIMXr95ccRft\nk2EEGn1dRl+kXeXx0k3Zl9hp0LFr94aiJ975fI0TnhyMNB8C8fwvMoRfC1HU\nG36O0yOeFPbTNkQ793opSGcYepQCdS9N79wqrfIivIoGCVv9+OuZmv1XtL6s\nE73xb6tkqEIgNL9M5Q6eDbldjn0izpPaaK4/noF2grcPFC2OAIfh3ovca23W\nYMLIEqiM5aFXNLwENqUZ/haZdmoqFn2ESpEI+GehbcRbTMDTXL5ZO5H4GpL/\nscxYS9EbgfkDKgJkgl2s8R9AH+yyhGsjtM+8yOX/g/vAidRp2XXrd4WNPWb2\n4/xS\r\n=6d0f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYIzAdH5PR7CbMYxjaAkVZ9/YpznT3K6rOpsv9pwGtJwIhAOct6E3omEIT5RCPLYw2gCkVHF8sHPEBQaGSeKjOHmwA"}]},"maintainers":[{"name":"radmen","email":"radmen+npmjs@gmail.com"}],"_npmUser":{"name":"radmen","email":"radmen+npmjs@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoose-lazy-migration_1.0.1_1578521356704_0.001543690400565234"},"_hasShrinkwrap":false},"1.0.2":{"name":"@baethon/mongoose-lazy-migration","version":"1.0.2","description":"Migrate Mongo documents on-load","main":"src/index.js","author":{"name":"Radoslaw Mejer","email":"radmen@baethon.com"},"license":"MIT","scripts":{"test":"ava","lint":"xo","lint:fix":"xo --fix"},"dependencies":{"@baethon/pure-mutation":"^1.0.0"},"devDependencies":{"ava":"^2.4.0","husky":"^3.1.0","lint-staged":"^10.0.0-beta.15","mongoose":"^5.8.3","xo":"^0.25.3"},"peerDependencies":{"mongoose":"^5.6.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix"]},"licenseText":"MIT License\n\nCopyright (c) 2019 Baethon\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@baethon/mongoose-lazy-migration@1.0.2","dist":{"shasum":"11f4d7f7680baf3ea764f7f1f4aa2d1592fb9a83","integrity":"sha512-9zf7ZVNTn8Nor4ODrqva5847X4BjtHa3iFTHa3yHLwdUNxLLcRTciPjcYcvScWBdES58edHQoi0rwbst9LeKaw==","tarball":"https://registry.npmjs.org/@baethon/mongoose-lazy-migration/-/mongoose-lazy-migration-1.0.2.tgz","fileCount":6,"unpackedSize":5512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeI0bPCRA9TVsSAnZWagAA5WcP/Asem2K21GXV0U0/EKn5\naKJUyRHfgYL7DQLM5p6pcb5kfuWzA+4/uTUNIaF2TL7LiRqXc2EftFu9T0Dl\nTZysPAthpgc0uV6xCvWpO6rC67bfuhwHR3w2camNHS0D8ZSeRbCxd1CeyV0P\nYWsUUfJ3AS1klddWjRDxcnOO/4SGmZ9udzIiSKoNzvKGW5aqKzbe7A9DMDfI\nLEDU7gUG/bBnxLApN0FDcRLKvUyQ1RBLM4HO6wu8ttx3zgaoirf+QZ+QA/lY\n/YJgGdBdl3rhsPQR60LxfzU3pIF+/sQNnnBhsl0m3+k+0fLGbDh0bX3rZeBR\nTI7sP0mHCHBGLGbOUGtaHNfTnnjp7YV5W8HKnBLsQacEmS/mMnu1eQGNmigh\nsdHe5454a/l2RsJBck3vp6GWlM9w6OVqML6NjPuXFf0CYx8WzfG1zpv6Tyjz\nmXqhkij2G5ynzM87BgV1fObKu/FJRV7BYcknDmVJT7ViRx1kFxS2khAH0Ypt\nfcbRFCxORLBYFqRXbdc6eL+zJTQfkvjMgK0pyiHFN8avS/M7w3Tm84ZkLXMG\nYDNPtenPMRe63HjoO6GvXsJQvv15owig8odGlMjjVbS9xvePLhrSNeyCxwgA\npiuXeNvU1N3YzBrSQYurtsWBSjUKUJllVw+87Wdo4c5C5IIE/fiPX6j/Q1nD\nD2UQ\r\n=Yjja\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICM5sOx/pjQ7iKfGBRRUEkTznpxJVcMr+AtRBDzonQbsAiEAkkaIpfoSi7iOz5xTImMwrRpnVRx2h6Clp6ctow4BQeI="}]},"maintainers":[{"name":"radmen","email":"radmen+npmjs@gmail.com"}],"_npmUser":{"name":"radmen","email":"radmen+npmjs@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoose-lazy-migration_1.0.2_1579370191213_0.08685757560114471"},"_hasShrinkwrap":false},"1.0.3":{"name":"@baethon/mongoose-lazy-migration","version":"1.0.3","description":"Migrate Mongo documents on-load","main":"src/index.js","author":{"name":"Radoslaw Mejer","email":"radmen@baethon.com"},"license":"MIT","scripts":{"test":"ava","lint":"xo","lint:fix":"xo --fix"},"dependencies":{"@baethon/pure-mutation":"^1.0.0"},"devDependencies":{"ava":"^2.4.0","husky":"^3.1.0","lint-staged":"^10.0.0-beta.15","mongoose":"^5.8.3","xo":"^0.25.3"},"peerDependencies":{"mongoose":"^5.6.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix"]},"licenseText":"MIT License\n\nCopyright (c) 2019 Baethon\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@baethon/mongoose-lazy-migration@1.0.3","dist":{"shasum":"7c2ccc28ba4cc6c09eb8b5ac9540f1af96d800c5","integrity":"sha512-aXAmqh3MyuqJ03uHAt6P/tttitHBtks+WAbRyYUrWoOEDDioovo07t9149mCBq1CXfN0ltlmOMVnoK/sxGgBGg==","tarball":"https://registry.npmjs.org/@baethon/mongoose-lazy-migration/-/mongoose-lazy-migration-1.0.3.tgz","fileCount":6,"unpackedSize":5577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeI05uCRA9TVsSAnZWagAAsLsP/j05RTPmMq48i9P408KX\n/AMD/YG9TKqWPBC0LIy0nzsMkwqurGOSnRcHQWkISrEqOf+nFVwHmDaRi7P1\nfCBxPFWTmeG8Nyupr7LTqy5jrwdFZuYEIRwMEzHuRJ9OxIXFmUt3v6xwSHT4\n6VSM05AAaP+TRsWYTbnwj8cY9gYtUt/9d81CrULtBLpKlPGKoCUmFUn5odkG\npPvaAy36v/nRBYVMceP3X2CXEKajfC7io3xWI4fqBT6uhteZSnS+v6virGRw\nqX5SHvGunyKklEFH9Lts1gumWQUs9mNYE072j5kujBEgvElpmRtADZ38/4Po\nCjlPZwlQw5b0G4CHSrTpj7KsApbqi0b4oiP2DICtRNd+9GMukujoQg8dGuad\nVvKkZwOlwR+QPWJ+nYyO7U6/EFJKtXMKgIDSzkBTdHDYSgykoZRZAMoPUlAt\nWyDVM+JRInBFqbZei5gJYROaWxIP7NoOJ9zIE5L/GwOsBOA5NFOZ7YLHfr4R\n0KGIppIgBbo/eP8+IC6GJZ9Wh1idGW8k//jBtAFlbaxB4fqn/2uS6W5O4U0H\nZyyb4EPPio0U2aYSNHKvdTzGQvz4uwIAlodEu1XLE0s2uvzj1NlmiwJ5g7Cj\nuJVkJ4vR6/Wm//WPbbB3hWdfubOSG6Do689KdQ2qvfRKWabG/OtCBboW6BEQ\n+72Y\r\n=I8Si\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyKWXwlIUDeWcuwz1tg8tw9nlqj7K1II2rV9bhoJ5CdwIhAIaNbDritDp1gAlo2BNxK0a870Ur7dXSAe19Iue9u3O4"}]},"maintainers":[{"name":"radmen","email":"radmen+npmjs@gmail.com"}],"_npmUser":{"name":"radmen","email":"radmen+npmjs@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoose-lazy-migration_1.0.3_1579372142465_0.8111329012628588"},"_hasShrinkwrap":false},"1.0.4":{"name":"@baethon/mongoose-lazy-migration","version":"1.0.4","description":"Migrate Mongo documents on-load","main":"src/index.js","author":{"name":"Radoslaw Mejer","email":"radmen@baethon.com"},"license":"MIT","scripts":{"test":"ava","lint":"xo","lint:fix":"xo --fix"},"dependencies":{"@baethon/pure-mutation":"^1.0.0"},"devDependencies":{"ava":"^2.4.0","husky":"^3.1.0","lint-staged":"^10.0.0-beta.15","mongoose":"^5.8.3","xo":"^0.25.3"},"peerDependencies":{"mongoose":"^5.6.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix"]},"licenseText":"MIT License\n\nCopyright (c) 2019 Baethon\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@baethon/mongoose-lazy-migration@1.0.4","dist":{"shasum":"975eead056b6899dcb450af4911829a8542e9152","integrity":"sha512-pvVxFhviontWul3aJGzUBb45g3+OgqR+zGzEm5r11HOzHxkq3SvfPFOLv2KiRjLcuiIqmStxWsQuNb0nos/mIA==","tarball":"https://registry.npmjs.org/@baethon/mongoose-lazy-migration/-/mongoose-lazy-migration-1.0.4.tgz","fileCount":6,"unpackedSize":5658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKC2yCRA9TVsSAnZWagAAZ3cQAJ1oDYTK5qeRaNt/wRdo\nx8V1YzgtjV2WcJU3jsWBx9ihq/8TCzia+fsKUP9C+u+vWQVurcPqC65IKbJ6\nfzT2KzEVW0nia0UU77uq2CJ7o9aKqSqa4q+uuf7qonvu/6mNXpOuAw9U19r9\nYgUsAs9M0iwmXj7Xws7VdAOWCxMZR7gtrJQvRKYNXuii/HrLDFssjeOQqVRw\n1kIQHjJsFZ042iSbmv4X5m1VFxoJUa9jcOOaJgW5MLESevVTJeFZ5Y9H4XSE\nBZ1JbQdnoIWbzM/jJKIP2/oneqjg7xJm7qH150g2d6+IlQgu1uqFSl8sibNl\nNwAzCJVSb98sXUY6szK38IgpAS9CQXRABU0ih0nqZsSe+fwFxav3PV3nAzT9\nfy0X/gB/8Xv9es3PPfNfD4HpWRqyfQL829G9tMNIPxNCPAgZpJn9Z+iAMsRO\nKWjTcYnqiarZefo+byXcDnwnQ9uZZ82OhOTjpzVKPB3VFbnMqpju831kZu0S\n2d7t0PwSv2TCyVFJyTw2MlirUIDjU23GimQdzDMXKRo976frEsm6qjJ209ad\nwONLsIzg4MfO2kOHHaS0iJJTEoVWu34uUDPiUdOIGx82wxC6UW07zLig3604\njViCCqki53ERt5V8qn08bESqaN6yjoud78WvVpBkmkKsyHe19ap30UEHq7kc\n1Pc4\r\n=dZZY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCq/cIBeUYJs9hWBqKneg5FPji7LKZcGlE/lJG7UjwWvwIhAN9YVAXlenuneer9m35OQ3QFco35Nk7LDiK8tZ9NX66X"}]},"maintainers":[{"name":"radmen","email":"radmen+npmjs@gmail.com"}],"_npmUser":{"name":"radmen","email":"radmen+npmjs@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoose-lazy-migration_1.0.4_1579691441196_0.06117345943817454"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-08T22:03:50.528Z","1.0.0":"2020-01-08T22:03:50.778Z","modified":"2022-04-04T17:30:11.292Z","1.0.1":"2020-01-08T22:09:16.818Z","1.0.2":"2020-01-18T17:56:31.323Z","1.0.3":"2020-01-18T18:29:02.615Z","1.0.4":"2020-01-22T11:10:41.349Z"},"maintainers":[{"name":"radmen","email":"radmen+npmjs@gmail.com"}],"description":"Migrate Mongo documents on-load","author":{"name":"Radoslaw Mejer","email":"radmen@baethon.com"},"license":"MIT","readme":"# 🖤💛 mongoose-lazy-migration [![Build Status](https://travis-ci.org/baethon/mongoose-lazy-migration.svg?branch=master)](https://travis-ci.org/baethon/mongoose-lazy-migration)\n\nMigrates on-fly fetched Mongoose documents.\n\n## Installation\n\n```\nnpm i @baethon/mongoose-lazy-migration\n```\n\n## Usage\n\nDefine model schema:\n\n```js\nconst mongoose = require('mongoose')\nconst { Schema } = mongoose\n\nconst userSchema = new Schema({\n    fullname: String\n})\n```\n\nWrap it with `withMigrations()` helper:\n\n```js\nconst { withMigrations, migration: m } = require('@baethon/mongoose-lazy-migration')\n\nconst migrations = [\n    m(1, (user) => ({\n        fullname: `${user.firstname} ${user.lastname}`\n    }))\n]\n\nconst User = mongoose.model('User', withMigrations(userSchema, migrations))\n```\n\nUse `User` model as always.\n\n## Under the hood\n\n### Migrations\n\nThe `migrations` array contains list of objects that contain:\n\n- schema version number\n\n- migration callback that is applied to the document\n\n`m()` is a convenience wrapper.\n\nSchema versioning is not opinionated (it can be consecutive numbers, or date of writing), however, it's required to use an integer value.\n\nMigration callback should be a pure function. Due to the structure of Mongoose hooks, the migration callback **has to be synchronous**.\n\n### Schema\n\nThe `withMigrations()` function appends `schemaVersion` property to the model. It defines the _latest_ schema version used at the time of saving. The _latest_ version is taken from the last element of the `migrations` array.\n\nBy default `schemaVersion` is indexed. This, can be disabled by setting the `index: false` option.\n\n```js\nconst User = mongoose.model('User', withMigrations(userSchema, migrations, { index: false }))\n```\n\n### Runtime\n\nWhenever a document is fetched the library will compare its `schemaVersion` with the _latest_ schema version.\n\nOn mismatch it will apply the migration callbacks in following way:\n\n- when `schemaVersion === NULL`:\n  \n  - apply all of the migration callbacks\n\n- otherwise:\n  \n  - determine the index of the `schemaVersion` in the `migrations` array\n  \n  - apply following migration callbacks\n\n- update the `schemaVersion` property\n\nThe document **is not saved** after the migration.\n\n## Testing\n\nThe package provides both unit tests and integration tests. The test suite requires access to MongoDB instance (see `ava.config.js`).\n\nYou can use `docker-compose` to setup local instance:\n\n```\ndocker-compose up -d\n```\n\nTo run the tests use:\n\n```\nyarn test\n```\n","readmeFilename":"README.md"}