{"_id":"type-mongodb","_rev":"37-aaa22ce1416e62367189df72b679e4f1","name":"type-mongodb","dist-tags":{"alpha":"0.0.0-alpha","latest":"2.0.0-beta.12","beta":"2.0.0-beta.12"},"versions":{"0.0.0-alpha":{"name":"type-mongodb","version":"0.0.0-alpha","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","directories":{"lib":"lib"},"scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"dependencies":{"mongodb":"^3.3.2"},"devDependencies":{"@types/jest":"^24.0.18","@types/mongodb":"^3.3.1","husky":"^3.0.5","jest":"^24.9.0","mongodb-runner":"^4.7.2","prettier":"^1.18.2","pretty-quick":"^1.11.1","reflect-metadata":"^0.1.13","ts-jest":"^24.0.2","typescript":"^3.6.2"},"peerDependencies":{"reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"f3448eaf45306b4ed5c827edb6e74c2b5e02194b","_id":"type-mongodb@0.0.0-alpha","_npmVersion":"6.4.1","_nodeVersion":"10.4.1","_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"dist":{"integrity":"sha512-7ElJAr74dNZg51fMBgaPuA6XS0h4rqKkDIcVc8SSDm5skWqjJhZgt9l5bGLphQ7QA73M6dgQvWpUnlfx3PTl7g==","shasum":"09ba6863c03b7c9f75bf4a39bc81a779fb6d0f83","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.0-alpha.tgz","fileCount":86,"unpackedSize":112532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgs3JCRA9TVsSAnZWagAAJtQP/2B/Z6OKten9NLNC94dp\nSm0A5om58utzc468ZW3BbllO90bu3SyHZp9WEnVHkv1VikaKkxKDJUeAuCoz\nl4pWUwPxWUVulJNV/Mj/5VPCCqYRuF3xhxeUCaYIj209EYpL0w2pyr4mFVlC\nUOZJ6aygR2KqASCLECbaLI9NvB3e+N1yieKNHNphpopn0oNEQ400nzwY4mFF\nmZjL7mV5QGwWLkD+SfVdrPvGwkL6PNY08T8evzHLrLnJFQs1ymDg1soZI/fy\nFuPKST70We92xnaOB2L45IBe7nf4KJ6dn/AwczAsWP0qYP5bv7OfVDoZ1Zqf\n52AbNAjxVwKhzqE3/Ppgm++3F/+Bs2d4H8IJt/eE+62xyNMN8/pGScDs9UiM\nouEU04QZYOkUBBJJTEzjwWLB80DmoMioFGb5WwZVasGbZFHG1MHJ+rtuiXWY\neRQpiUdMsO/ZK5Hn82ADQ8MhQnFuUgBdgTNdFFxKxsujFWsQoiGnVeOakIfD\nDjUd3XxLlM55kb9nnJDcPoM0JhJBQQHnqybKZbq5PXu27n2ctM2TBMY8S8bO\nhj1Xj16rSz2QpAtdxa3STwp7ToGnwOeZum8F7gDq+zLauMcZbsUH+r5uRZBW\nqdifpuh3FNGDzSuXohGQh5Eq0wBG3J38er3b+a5F3ULFJu0++wyB34UDF97E\nPEaW\r\n=tbMS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBPYqIgL5/1HC4IU3uIPclDHHTl//P+NATZLcW6n5injAiBeeTbEPgp7unPR0a3RV5v4eBhf1rX2S0CuikOKenA0iw=="}]},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.0-alpha_1568853448666_0.18094151593637497"},"_hasShrinkwrap":false},"0.0.1-beta1":{"name":"type-mongodb","version":"0.0.1-beta1","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"dependencies":{"mongodb":"^3.3.2"},"devDependencies":{"@types/jest":"^24.0.18","@types/mongodb":"3.3.7","husky":"^3.0.5","jest":"^24.9.0","mongodb-runner":"^4.7.2","prettier":"^1.18.2","pretty-quick":"^1.11.1","reflect-metadata":"^0.1.13","ts-jest":"^24.0.2","typescript":"^3.6.2"},"peerDependencies":{"reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@0.0.1-beta1","dist":{"shasum":"128426f9acd3214c3d4fa005cba5d932cd25d28c","integrity":"sha512-fUlHQ1UoKCA/9OjVeAzcyn0dTFtBdDQaPXDd/QpjVagFlr0SCXcOpuSM/bj5cUQ17UrXQD6q15eJl+sHampNRA==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.1-beta1.tgz","fileCount":118,"unpackedSize":173616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQdoICRA9TVsSAnZWagAAXF0P/Ax965v6DFkNP0Wv0rM1\nXjDoQyviin0aGH71mwOseLfW8yiq9gMqAl6ff+nGMk/cXhQ2+20bgm8FE5pZ\n6Y0m7n9Ehp/K1tna3dd0pMBUY+IC2J2LN3T+/669dL/Ux6+p0gEllmYWaXl+\nKQl67V2sIWtGU6UHat7paZwR3/iqRQdDohowB7LkNRvN52LYAwTHEDTYysiu\nu72P0H1WUKBkP3J0ThamJiZZ83RsY9RtSt7s6yv1NrVmb8rx8lYrbQlqAKC1\n1tiHZvJjo4n5yCZ+7qc8gaDtYtHrKP89cpj6J/QwvFwW4KRoNDzi37dLXIei\nJAZhQSC19QL6q9WctgT2htVKtDPCfB5ujVt3AIOUUPkHT7B78oCygBYZsvYJ\nGbjeEeQlhpQ8WmRcdHL0X5xAlt48mg5G5kMxI0aEgU3PrSI6NgA5oQ9A5YsQ\nwoBf8yF6xesKTcpQGqSIS1tXCBemIDo4t4Og2iCfr6Q61gNHVpYK0IJyYaf3\ns31jBagj81bt40s8Hqv7274HztEuzepPAIdrsDflTBjop2o2uMgbNDv6zJJ+\nsGmnOoTmmKYJF7+x+NBrwsZ87LubeOTKiTaqUF/WdkpfJDkDk7lRZRsHpPdA\nA5feQBjlzbRZrifqsUJkKhhrcgSsNQUv9WR3uuPTlq0qarz9V/T0xUjkab+J\ncnc3\r\n=lzWg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5w92lqACviR28HV9jslTXlX5BOh99tPWMUvBoyu6jmgIhAPt3NdHDj3X5mVWbLK/U7CxqpnjNOFfl6aDiW/C5iBc4"}]},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.1-beta1_1581373960022_0.9304801782955638"},"_hasShrinkwrap":false},"0.0.1-beta3":{"name":"type-mongodb","version":"0.0.1-beta3","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"dependencies":{"mongodb":"^3.3.2"},"devDependencies":{"@types/jest":"^24.0.18","@types/mongodb":"3.3.7","husky":"^3.0.5","jest":"^24.9.0","mongodb-runner":"^4.7.2","prettier":"^1.18.2","pretty-quick":"^1.11.1","reflect-metadata":"^0.1.13","ts-jest":"^24.0.2","typescript":"^3.6.2"},"peerDependencies":{"reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@0.0.1-beta3","dist":{"shasum":"84d001fe9b652ef2e8a029c2e3d7228429772ca4","integrity":"sha512-3mwfevSyIWCqVUQKLJ/PhZCje55cyg9wHIalcKPXVEOl0Q2azJvWtByLeUiMcQS22tOmnUm4ImM3yARepjH9Bw==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.1-beta3.tgz","fileCount":118,"unpackedSize":173580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQd+7CRA9TVsSAnZWagAAHw0P/i9lMsTg7EwQAGAPtRy+\nLqaMPk9c4ipZHxexc36KHmC8xEPzsV+KzfNSyrcRy1dT5yInRgJUp6xodQqh\ndHL/QCeLCiNULybBXWmH0K35zAErXI8fD18E9TRRXNptIYcMxTC3n5vWr+fV\nS+fBac46Ri8BAJ5fmE41dHxtTUhWfxxoxwuKh/J/rk7fJO2oj7YOFoUA3M1E\nkRaa4uYG8VuxFz8OGfH9wnEVz881thqrjoigR83sYYcD+9s4AizNgnZrDGj5\nAqYWo24euki4LaFJJp56U0B6L2xsHXbgfM8XOiXZgyJyZC6kQX/sQ0vQanL4\ny+05mB/ETxM6uZtx9ZpwxeD97jvivhMcX4LPkTkA1RnJju+ZAUd8p+t6+I1F\n9nNv45kf1MvsBQ201xFfNsQA4aKpllPVEq0qEzAOVo1syEqmE39UmX8YwUYT\nSL15HZvdvKVKmdFw5mLOWZ0ZdtXfXb6qctwL4QQ0GJnOHDm6Wk1X/YVk7pov\nGK9Or8wHd6LvdJe5fMxrjAPNAcbLgUpWm9NerHN4VGNdY7he2ldx5E87s7iz\n9Qwlk5fZBd2jOXaYOLIARFsGhDDoeWViOd0yydhDSB/mAi5J6D1ZXD53KGBq\npWbvIanTpjB42axKvLbIO6vvTfDGzD+cy4085MpMOu4yMbchv2ajvVVLGIOm\nABVj\r\n=H8CH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnnBiS1uNa4SsmDjOhaTgYxnOsm27XTUl+88Uahf7k8AiEAyqNg/inzHXNz1QoDKuVI35EchowDTlALojshoEfD0LM="}]},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.1-beta3_1581375419197_0.7193270149845277"},"_hasShrinkwrap":false},"0.0.1-beta4":{"name":"type-mongodb","version":"0.0.1-beta4","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"dependencies":{"mongodb":"^3.3.2"},"devDependencies":{"@types/jest":"^24.0.18","@types/mongodb":"3.3.7","husky":"^3.0.5","jest":"^24.9.0","mongodb-runner":"^4.7.2","prettier":"^1.18.2","pretty-quick":"^1.11.1","reflect-metadata":"^0.1.13","ts-jest":"^24.0.2","typescript":"^3.6.2"},"peerDependencies":{"reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"675f02d83f41396f4a152380984e4032389aff45","_id":"type-mongodb@0.0.1-beta4","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ERC96NfIly8+KySFavfEZT1FY53n+OR76TzyipRHnsDrrHw82MvhUsVTCS54hVSVdMyZjpQD24lOCRYhfNnQKQ==","shasum":"73cd490457d98ae08903bc584a345f0cfb140556","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.1-beta4.tgz","fileCount":110,"unpackedSize":176729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedVAICRA9TVsSAnZWagAARkIP/jnsNOe32SwQk6wR3PIM\ncD9hTDLuVdWv79ixn25KWKYYwbkgXTwl2JxED39MQ51CmhkJxwJGFTXpMmfN\ndObOfy5npYhq+l/bqAnF6PEGL0pWh5Pg+djLIC3hefN6LKbHqnIck/0uGOqH\ng6UCrUfPDj8zL6sXG48aLxfANHhVpFJWRsw7nspkv1C23S7gSKjWiI3wnYI4\nosflMe9L/VZei/g0UrYAGk89Gc0skkyG+EOcBWFhRpMENDTJYSFdeIyUA6Rf\nC01QiI5NvEjt8j1r0eP9+Cmf8uyHTgMatWtaFGBVOtG6N+2p6rkP9JzKa27o\n46iLUzgIgueF73CrUnMapDr9s/We69fL921VTsU2Y4AYthY8ObWWdA+IcyjY\nbph1urMgipggBoocXQxj8BovHflgASRBiztJ9D5+8TsLVlz/apD7flmIMsdx\ntbunV3++ozqu9woF8JQZCiXQ5xvnbI59r6XIWDUWjLSL+G9TcvHv2ii+dQfr\ncqbDDtVEj27f3laJVdwzzi5JW3Thj5G/8DvRTbwocZeR67TGdYn0P/uQqjy7\n5dPH0gjhiuEyf7KU+cu0FWzKWJUPbeazcdDYsZ6wXhf9qSBqrruoMZnsOdg7\nEVKPWDCKLWNhhTAHNXsX0ejinLXEo+2BHNTvRznQG4QyGGpkldM7GqH9BEbO\n4g0k\r\n=kNWD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGgDrDAskNK8RLX4utrQhmKTQIWaVKW7ZDj9h2Qb9mCIAiB9deQ8i1pd6uX4YJiJM4nRpKe0bzcRstLTlgSVnYgbLw=="}]},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.1-beta4_1584746504105_0.5353575748128101"},"_hasShrinkwrap":false},"0.0.1-beta5":{"name":"type-mongodb","version":"0.0.1-beta5","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"dependencies":{"mongodb":"^3.3.2"},"devDependencies":{"@types/jest":"^24.0.18","@types/mongodb":"3.3.7","husky":"^3.0.5","jest":"^24.9.0","mongodb-runner":"^4.7.2","prettier":"^1.18.2","pretty-quick":"^1.11.1","reflect-metadata":"^0.1.13","ts-jest":"^24.0.2","typescript":"^3.6.2"},"peerDependencies":{"reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"097e30a63f4d82fcfc4435665e24239795f546b9","_id":"type-mongodb@0.0.1-beta5","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-1iGp5DIYKWGvwE2BoTP3H6rK6csgUs08HjWeSR7gqR0ppuU9pf7a67tZ4eTQXkxhOrrEjOvOIynwwqaPImKQBg==","shasum":"68d6624f1a4c0680720e881040ea5e72e29d010f","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.1-beta5.tgz","fileCount":110,"unpackedSize":176834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee8ggCRA9TVsSAnZWagAAHPUP+wd8qVPnUFrdgqcZdwfd\nmsr8XvMW9LU6gO6AS/nWfDlYwYPe8acJWwx2PYdWKmRSqO/t6R27NmIw8MTy\nGWzURwcLfOdgj7eAQSy8dFG8AfgPmmOGfbYS8qM7HZKuGb8uWQdHPh7+s6gv\n4bl5mE++2Qha4bDa8h8ZJlFdNg1yD8RSMnliWtuY20AeKs7L5OupT/yjPa9N\nlUIQ0SY+8+8p8yMyVwxz/ZZagdM5XHnEn5WdR9g8iwP09jMoPeFDzWiO2/FE\nwt1meqh1tLEPpqRoRT3K/tX+mL6C/WhO1YCjrxCQVEp8OhG0mDWe6po8dFSY\nATgx5jXBc8J+ZzVmNPz8BEEZweerCj75PRc7n9ZG2d+S0bY8zlR4rTwh17eo\nHEMgIlxLByXMr42JcN/7FRNeEmJBO8XS4HZJqTgcwb8v8aJuUHzhOUXjqN1s\nKkKl1yjg5MwWYPWDuLCHGpr7W+DFQInnZK2LGAIUNRmUKyzdX9fBgaYT37ci\nn/2lVmMxlCKHtMLnChYxcJ+s+CugAmXRq2gZzW/4nBO37cgmyGLat10t/gLI\n7gvxPNNPsvnYengei9pSMHsUA3QRAIfYw6V6gLM94yNh/nvakVnDVIBkVTnw\noqFzS/rIPa359FsCe/SZGP7cE6O6HIS+do8pLdfL9j8N1KI+5l+oVVbI7hda\nrjsj\r\n=ccPf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn6PQcwH//pj9QMRCpzhoqkC/09vLZZxRWzl1dFphY/AIhAL0L0oL6vI/7TJjqr0lx8Kq0WEj41pJOlNaOPVLSlZF4"}]},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.1-beta5_1585170463600_0.9417918067808821"},"_hasShrinkwrap":false},"0.0.1-beta7":{"name":"type-mongodb","version":"0.0.1-beta7","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"dependencies":{"mongodb":"^3.5.9"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","husky":"^4.2.5","jest":"^26.1.0","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"de5f3a7c4ee97055522535aebc509cb3dd5f0deb","_id":"type-mongodb@0.0.1-beta7","_nodeVersion":"13.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OBelSueXzQyhVmjwFVI/TjOa0tTbvhWuWkwPLKSK5jlH0ANjGqIhSy4BvgKUH8BHZEtbObgPHKu/YIif+z078Q==","shasum":"629cc22400897db7f0d31438d171ba624229d71b","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.1-beta7.tgz","fileCount":110,"unpackedSize":179858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+6b8CRA9TVsSAnZWagAAeAIQAJaDE4LBaRgIAH382BcY\n+jzqX7F/zaNKL0cslq/mzP9oiK/fqUeUQcovBZ3XZi1v2tK92ne36HbWxNrs\nOUv4NhyTzAzgTuO+Rn+w4NxSf/6tpBvjRHMDqMSNEmVITngR6dy1MILaEAu9\nUwMxomSRrtQoC3n8FTwqZoD8K6WWzZyrHg6DbMOCJiLie9qcwploL4c+008B\nmxG4wn458rhXOnzXOG5DnzjFvto05ktR8+eoWyJY0YK7cW5JdBQ7u38o38Q5\n4QelZSdEempxDzg4EB/zCoReeVgUBX8meFJLtGx0YApmfhcKmqlyYFtRgyID\n55GzuPUT19iZd1njMoUyMTZmfMTzNmqMKdDuM3fZhlDTOjDDQRLAFaR+/dZX\nIo3NslDc2tY30QWu7YyeZ4Cp9TlFZBIlBiXA7Yx0ItA9FqoBFQCNebX4E6LR\n3njNie6+E55pXnwn2g5lf6XosEZmfm712yE+O4uebNDBvY4SMV0TrmlkqBb1\nYr+IIkclmfsQBbWuEQGMZie+4FeiPbzDqbI93LyEF+/MsQ1b4DfRRQBJqPWD\nw98hy9xEblzcJB5j8rvsapZgbGpAEm8LVRk5EnJtCzJnWt+EIBQACBjVoTiC\n0emoCRqBO/It08NK7Zlt19sDoIRFzkmvL6CNKxYwpInomRkDbe7KNFeV/yCA\ndKrY\r\n=3Zep\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDKYv8Mc7tlEOSy6mAkOkeXB7BoMfoSnTf4Z0pVIwRbBAiBmdZV6v4BL1hqusHCQTjWHXJ0tnls8Wt0wH9A28vd5kQ=="}]},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.1-beta7_1593550588261_0.4818710066452634"},"_hasShrinkwrap":false},"0.0.1-beta8":{"name":"type-mongodb","version":"0.0.1-beta8","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"f5b5b6c8fee6077999976b115b4407d880a28bc8","_id":"type-mongodb@0.0.1-beta8","_nodeVersion":"14.14.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-IdDP3fk+LbtSQghRZfyjBnOgg6nIEs92i6ZjCeV0jlIlFoQJ6XEuSf+iD8O8ooA3G1yPkEh4yPXJpPpSHDyavQ==","shasum":"d21157f41f069d4a71073c1b8dd73f66bc373fd3","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-0.0.1-beta8.tgz","fileCount":110,"unpackedSize":180350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0q9CCRA9TVsSAnZWagAAzn4P/3+dNmpBr//s7dG4oXKu\nLsHan13VutT/reQDHV0rmivd+XvS3981AAd+NabuPwyNJE8rdX4zrgS2P28X\nl6aPB7klRKwOpsbn2QTDv5zQGyKQ0G0wAylGE1AGd0qeQwD6Zq2mJOVK3Ce/\nO2wWhCMy5Ltnq8DH23iWpL7qfAvcWYZk0waOHjzJcKUDVbgkjsGK/xmgMvqf\n9roMy2626DcB8XRYfKBC+tB4XK1icmNx8OlcnhiN72OsymcVRGQx/50UUxBC\n6E3OrIBINautOZw1qtdA1ZXSrB+qZsSX3MudsT75kv6ayRWcym+YTnkZhwA6\nqgGwdQVkFNeNTWgiQCuFNr8TSfpN9tsnKfuf0bjtO+/3wnO4OvO2SX4EhdCb\n/YNcTDhco89MpsCWO1JAAc2Z5+0bKW0mB4EN7ILxQpFmVmV1yBV1wzVZTtOL\n8kFtQJyzcnYVhXgnnkGdooQhBgFy8Vm4XcH1dpz8+eAIsuOIPjExVBXz5oNG\nKQ4C1Fotqjjd9+ZMAB09ekmL8NQYvFbR673+eWj30xmS3UfudtfsTFD8o/Aa\nnMeHh5P0H2BISsvUBGjvjc7RcaZFRqL5sSaXCuZIFtM3NmCH9XTCsUDC3sD6\nQ7lCzFDPqWcOdnYcnu0xlgBP5/y+XQu2B08M4Oq/FkE2Fp8lV8ejChDHMTLv\n6i8C\r\n=k5PQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvhMBuvGY7+HCrudDM6KuRNPRbdNuiU9XenKb3mEixnAiEAsemtMW0y5TYuUhHqkoNVgveCAytH99YoOaTvQC+O0sI="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_0.0.1-beta8_1607642945778_0.38377662388070544"},"_hasShrinkwrap":false},"1.0.0-beta.0":{"name":"type-mongodb","version":"1.0.0-beta.0","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@1.0.0-beta.0","dist":{"shasum":"57a7ff2cbe1334937038c2f2a95fc3ec78915a30","integrity":"sha512-dnhGvu6A+u+GZ8dt0cikA/tERnHDcKy1QNycmxW77+yBfW0u3fbHDmVXWFF85ZMa41hzsDSFgQjkFaWSUjQFRw==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.0.tgz","fileCount":126,"unpackedSize":201973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2/hHCRA9TVsSAnZWagAAnLwP/39ct6ZJf5QYjjx5U0yj\n48XZoss5S2w4MaHnRnZRXx/0gBcsH7nbHU0U3paBBEGiTnefzG6ylRONMP7E\nqd9CJmfiFXkmhrALJlSz8U/VRqlEozWmRDbTAfNzFhNDW9Gc4roub2mOTmJD\noYLmFUcqyo9qkH7GqtyO1qMu4GJ+1ThstG6PD6aiVKdk0yvkG3HRJWsI7fO7\nQAwllPugshnfdSygYyKR30A2ZrloW8HUO7cPUOrn6L5N5uh5DU1KxFkT8RT8\nqLej3nnOQZqIcnFVjAW5LhbaBr9k395Er3YJjhWc+AD5LAf4zojni94gzpOL\nVB0qcRSd9EnLIk4u4FtrhlB2X8qFRjhlY4I5468S9yzGb9aPeU924CltMRFE\ni/Ku5deQ1V56fwkKKNNjukfy8iMQjk8KrITVpnZ7jSuypbPfcv+ZbDnDy5dy\nPwI2SVjIZrZh6zxfw69MRTUj6bkJdmovxYt0OAxG3FPmIkbyICjZrVgsvfpz\n/72rS8TJOp1c3fprDH/vPYvm3LodiBiFCmzGgTqFY1+VsQI6E30cGATeE0VT\nKHPxLfidcxH8D3NUjnsnA0k8pwH6pHS2PjlImfckQJNyaa9krDmHifBW9g6A\n6MW55djbp1Lti4174wOg5kofmQl38Ikjy1oDYKJEG4520h4AjHHuS4E7wHdJ\nFfFJ\r\n=k6ZE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEd5cjx29Z3inn85HzK86I0gQRPlUlFMF2AxrOgsZ8YLAiAy63fFZgGG70V87qd2GQ16fu78m59fI20GTHZk1lsTsg=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.0_1608251463150_0.050356519111010245"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"type-mongodb","version":"1.0.0-beta.1","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@1.0.0-beta.1","dist":{"shasum":"e4c051274ea0e97c4f64e72263cee9958564a48a","integrity":"sha512-GcyAVfBS4IFyD7YEXeSJyN/K636xZOy0X3ns/SVPuijQTweYxWML1sUA4OleXFRuQIKfqdw4ZE7W9oz0bmmoAA==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.1.tgz","fileCount":126,"unpackedSize":200692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3Q1vCRA9TVsSAnZWagAAqYEP/iyycOLtX/PT+aqAwd8e\n0aiVnZpH92qZhQdNvdctqYpaVcCCod2cOQHL0jw9tImeM4KAVvXcJ9PR8+Pd\nSbyvh1bERKSDG1KNnRhlGOysl/9KkKyAupMh3A1IT1YoL7WRqK+iiGJW1yOL\nEmycmsyXeHNbtrPV8V+duw8P+886hvGRWq5Lh2q7DWeI3Bwr/RyrZjdg0S2X\nGhgrWY2HPLjcJCm1WdecvsUFMcL8lYTarXVv38psiRPrfVnKhMoQCNV00jND\nHWtA+Iupe0usgE/KscHOKZHs93Dp0WvDgbm79nflP6F4Ex06tlKEd8VYDhui\n/STiWjWiKH84asWGpp+nJRBOZ5lPjdOWUGYjo8CYKk+R18XlivL1Kt8SO+o7\nAwCata6dr1XNcP4kMq43M8UvlyUpScBJAIE9JcWoWv1J69eNR4t+I02YSLhg\n/bIc3vfoV46c+oNOvcZPTXpSN1BifpKlzyAi+sRCy++dpdK5Iqh/TZXyOo8D\nJb4eTqsGbmvE28TLdnvAWvormzmXeKNtFB36PVm5cSnIX7uSn8AY+hmXYlnW\nKZEdoVU0VMd839oPvWff7kPyWG3ksWf/YrTu5TDi3B8104MEavIjXmvVTTOV\nqrfQLzAcdnSMFeUGQxgsrlm1RmczKVI0Bv1bT3DQ9Dy1uP8TGaA/UEJXAuIc\n445S\r\n=wy3N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiAK4cVCSZCPpaABkKx1UKMZ23MjqSrVdrIh25XypjZwIhANBQc2qSicOmkc2kbgw7F5JFpGTIW5D7z7dBeazTX/es"}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.1_1608322414830_0.7535247663094893"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"type-mongodb","version":"1.0.0-beta.2","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@1.0.0-beta.2","dist":{"shasum":"d45c308373dfa1b0f3ef96b199eaed76b670899b","integrity":"sha512-E5OJ/scNbZULYSzc+2nA5ngIt/BK46hKS9Ij/XLW0YZUpod1CZ9bmXFizrJYriJdJ/eMvfR1/BXm+xhiGBO8tw==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.2.tgz","fileCount":126,"unpackedSize":202578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3U/nCRA9TVsSAnZWagAAJCsP/0wh8OK5D/qkA1ovWYO/\nZzVWXvISbHpF2b42rYrwVDVbITgd3kb62pUnaYnojSAqO8Ax8aNKGMmve4Vr\nIz+FXON5V1/qs7+MaHEqvQNxFkcUbdUnpkMK1yJQ32TLXu048SmQtaoKD3RD\nT1YYZXssJduzzcz0Dfntcb1cU0uhtglJO+2hpXHanuBxRKZAg/YBStTBrnDo\nXd5oSxxC6dszIAzFzMDtuh2Vh0FjL+Mw4gFOBV1vB1tS22WFnkQMqUW2GTyr\nU2HGeFTEgHGKGEyLoemUTuGnPXkpPYqJa9wyYqInRBF3ho7Lto8p7WRmDOLH\n05VVhVf4dbP7qC+QZIhUuIw+pkXoN8xJnq1pVJMahqxgfmdMD6cz0dpJsyc9\n7OLmRKCHzCN7yufQkUwmhspO6S2RuYVvc7Ks6eCwqNlal4uueYqJ+Rz+g734\nD7QlxG1wZ9g7a9LFQ8ViTSGTY7YQm8aHOL+zJmMZsAbcWmEo0rLPgEAaR+cg\nKipURU+A/C6qml6W5KiTEJuiWPpGSY1pulqZ21wn+RW3ABnAsO7q+5ecKnA4\n4+Uo2zMNOoClDagA2uOLV6MTmTLLFpa7/z0pBqIOmDBxI7AG+hg6UGOVdOBw\nYkxMargtpdgPvhgGptHxqmEN8Xsxha3eGGjRC4Z91oIrKmoTyCYe1cb11dYV\ntNpw\r\n=zysG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCArz9bOMOEJIyrUBRPK1Ie/Dac3X0HwdKVSpF22EKmXwIhALRMW5XrEUlEAEyG13XbCWXtku30fBqKGDlxuROaHUp7"}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.2_1608339430831_0.12553253578098578"},"_hasShrinkwrap":false},"1.0.0-beta.3":{"name":"type-mongodb","version":"1.0.0-beta.3","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@1.0.0-beta.3","dist":{"shasum":"78173b2cb15a95c2a2699766988204d8a61eb179","integrity":"sha512-B80PoN+gYycG4qVzfHfZyhIXDkPf1IjhZOiiv7vxEFse91CGVT1TlR2vSGgYYOuMwhGeJimBTKXhf7WSWEBKuA==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.3.tgz","fileCount":126,"unpackedSize":202708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3VDPCRA9TVsSAnZWagAAl7EP/2WfWGWoNhwe86FZH66I\nmjx1VwzG1dl1s4WEUTRDxevTz/23wVzaTU3FMwn2ZiKUUIwqPQZKwLRwiSR4\nq7bzLsJeOJP51iu3kh1kirE8xKRbcWPPmrWl7FOhi8jkS/rUFJvUFfi3FaMW\njwwMLAlHKQ4ta0cKP5z5U5s6tp57jY6tEVWubipNQ4rhzDVnwl65DhK3ADs3\nh8xT+cxArSXGtYcQiHKSV4ksCxWyOJUX5c4/fFUXssEoXnMDeSNOSD86PgWg\n/oZctzsPPYo+3rEAl7LT+32tdWmeu44j8+vm6Sr1sybGnw3kyWokFRcqwhvk\nhu5pTqZclh6tRCxZ/eIyi2y2tgTaFvSRE0S/DtVuVUvrnc2vv/ZBuTi+8Z3y\nn3DaTR2ibB+aJk80lqr3Asl+v6zPySxbemLHKEzxqNs9zPz1KTorSjCc1fhq\neGQyVw4qDVjQa+4XGwvKW6fbrU4tqssXe66ZxgVMgVcuGjlaJduL2X5DOeA+\nU4r6rBw3NNmrLu+grWOVw0hkdT2PrL9K5IudhcznId98x5cbL1KW6wVt3gRX\nIAXC9AGg68PpZwnzK4zgBmqGnesN+Z0uR9Z/3cVTr1rJiqVRAMQ/+61/FT1b\nj/lgTXEiX6CUJb+Vak4f2dRyGkt/WI6qNzo/Fx/hjT4T5Px66cBhn6+K4JEp\nr+Rx\r\n=mlgo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGj8D113fxwxevbTz2zVlF72qfL8LUbYGALzN2SMoH9HAiB3pDDUlE0WwJNKKxux7Sk8QgN5dzpyuOefTJZnB+hVJw=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.3_1608339663353_0.9929230408031"},"_hasShrinkwrap":false},"1.0.0-beta.4":{"name":"type-mongodb","version":"1.0.0-beta.4","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.4","dist":{"shasum":"87fd75a25abf1600d09d53b793693eea40db9626","integrity":"sha512-cFqhudHQzssOO/3ORnAC1Ki67ulviYwpnfnSRRv2dXY1x3nyrzIk9FAwXPMe49Sx/v+7bjzlDEkzIQKMYt6uMA==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.4.tgz","fileCount":147,"unpackedSize":218322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/22NCRA9TVsSAnZWagAAGWwP+wdqy3HvMD51w2nN0Zi1\nKAs5V09fbkBzty0nf7w7W1+LBNEEssE76T++0UkxtRxPCwGlvJEGTzKlCE63\nB/frFcOVArru/xm2vD5zhW0Wx8UW8ph5IrrK4F47khwrghAJwv3EwHcKnrHt\ntyWhCshbeQ6MUUQqhRC0l9+qKRZqJ3/b0plBXsr/retnVprk29pZwwm35B8p\n+Ly4GYG6nPYy+PZhiI07GfacPDo6bAwRzqP0Dnj1HS+rPHe2wE2jbBYvYjpR\naAwrX4CxKWS+s3u12bIi/07OhycJnTdaXiXw7XrBA19+R1DcwduVP8NL72Vm\nPP9gyFW9A6tb2Yl9D6B6c1aXlpLEpg+FRe4cVq85HMvzoCTJtZZxJKu1EZm7\n1oIJTQM0t2J0zfy4EbXo95Kd8OTu2TWkYS1Y9HiFiBMyq7gET/KRQJTf129o\nI5IySmlOGADSW/7Ppu8nyF0QQi1Jsp/MQwpL6XqVgJU997cOVH2ol9fZSa2X\nt4Atm8AYDG5ACj2zVEhhejau4QtXtxuxNh/5P1ivdbYNINNNJUQteC+kglA/\nic7RdR6XuUiynyMmmcTzgpPcC+of+eai4w00ZrrdZbj0wiWVRsIB8LcK+MMD\nWU551KpBURsF4y7tAam/iD+oX+zlz74KuvfOwodImHZkWtrAjkIOvL8/Vvj/\n0MH/\r\n=wv+O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuNZ7QoLQBAWAxTuoL1SdRSo2XqEbVbMZB7AjL/N8JRQIgIGLc8Xub6O9yYRmgKyl4mH9BqrVrTn5ZijwsLEXa2fI="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.4_1610575245129_0.5807204340954193"},"_hasShrinkwrap":false},"1.0.0-beta.5":{"name":"type-mongodb","version":"1.0.0-beta.5","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.5","dist":{"shasum":"d17751f5a1bba2a6ac3fb6b4a2ab53e537685044","integrity":"sha512-PipSwPTmLdN+b6W+J49++uec5GY4hK1km/heG+RxTgLlI9utQU58KKeBlbpGO8K8xcc5rD6ajnZK2S6cpK1G3g==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.5.tgz","fileCount":146,"unpackedSize":218414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/27bCRA9TVsSAnZWagAAKnMP+wRyyGVnf1P3U+oL987L\nwYpq1EPkPpzWvnZN0qVLCvJpKuaONoWRj7k6BfL8fANUqsPzpkBaPw3p/d/Z\nvSYgt7sMEc/H9sSGKOoW+i2IoxJPDH90LA0hIVpKjF3rRmb40px6F91ufojb\nWzPTZnQ0L1kxYhFOswltyHpso5OFIH3I55wnnhRngcN33RjAIBUEvpmTtdvq\nntM3tCwvICWg+cyqVd5eWkQLr58l6178pLlS8GnEShE1bx2lbctVHwd3poLj\nnzJTDLuKH5n31VuRoS6iHYoe0vFOzMBDf7SeFgzr+2tIMtFXTFiiyvuw9gg1\nznXa6P13U0EZ4R+78CqvXwi56zEANuQ14N1G0J5VIwjZPTiQShWsHh90+A/+\n+EaZ3NHaHtGFOh5XH1V7kz65CfUp+VAJLimK6u/6iPMLdtk0uNmx1OaKhJhr\n2m3zqIVwGzpytN6YFyGOEdfhHWffNBxkK9rHpsBe02tNzm1zYG6fR2PSgFot\n9pTrw3CpWvL8i4KkJVY1+GcRIQ6NUF6H11nZbfWxAZqNc2EA1h73sAAOuoeh\n9Xipjkb9Fcunh3WazvNtvX0n3oKY7TKz7yoRbSIVKkyKcXm/B969jt3NsFWD\n/HvMN1PS0LuFA7nMVY+x6cxAv0f4RZ1S89k+kvcS81o40bdLI1N+hWYQZoxk\ng0Fy\r\n=cDSc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgm5sXiRvIts5YJikTbz97k28YUqDPgj/rAf2AOUUADQIgJ4MPE0f5MpqZMAwYBxUNemGkj0IG/udRs7wytDYIE3s="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.5_1610575579337_0.2916636529729393"},"_hasShrinkwrap":false},"1.0.0-beta.6":{"name":"type-mongodb","version":"1.0.0-beta.6","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.6","dist":{"shasum":"5da94c9307ec65be54ab56e855d04a4622b934ec","integrity":"sha512-3eaPmAZtUbtB3c+gwXEOyuRFIjuv1NEfMBRDVrMpcDSvntOgFFoOiALCLhZJTm1bZGhYzt0278Hi+UR0q3P0Jw==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.6.tgz","fileCount":146,"unpackedSize":217332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/3o0CRA9TVsSAnZWagAAsD8QAILvRJsMWCLxrUTcEDQn\nbTCGHmIXMEytxeJ3GAw3CB1gY7Uhcm43z3c4x9Y81XKbOh+wAMCkB72ZmvPo\nVGzLeWF0JmFenXGuo80eSULiajntgAfVe/3Jrzs9EHu7xoEPx+nmZqszJIJe\n4eA8zDlHGDZaSO2Y8ZJbPAaJIYabAbFZsTLkDlWkfPKiB45/s7MhJPzXaMrm\ni3+q0vohIXJwRX3AEBAkJmpx+6c1IRwKufJOTml2BD8Tl1oloDmDVj71DnDQ\n+lvO/rS2gx7X8S9HsrIQrCXmqkbgnDyCy4oCR1cPyJ7UluhBqpA/dfAsT3Nj\nmc86zEisrDRYH1WqeWFE+ZxV2F9cGYqc82Fzr373H1KxxgUtMaboHVFz0fMe\nw2lFKRCOomOpZzVwSy6kpBME0/xq1mH8SX1UCdO2bPD1XzItgZropb70MGqs\nDUoqffSpASjufW2nf6AjDhkMsDR8fyZpsSTwjYaWB7/aF0dSACdP0dBgKJWy\nWcY6M4914pmFURUtWIgSlZt2jX/Ym24KyqFzDPgs2oMRnfzEYDUuVpAR5MGo\na65aOAfIokR6FROi7Dgm9hrgvnvqFvQrg4fAdX/Ege2jJ4chW0UHMz/bvesC\n18dZKJibe0xt3aeBg9Hq7kv0pgQ/b3BKJ4LBKRcQ2AdzE6zOJZP9WrfVYxkG\n1VYu\r\n=0HZG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbxnC9izCzcR0vkW0uQYCfBXziRihT0s6bT8bifG5xLwIgfsWW+hlBckBoQATQG5hwtQcTaDpZFnpgw/WVyQVIQhg="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.6_1610578483398_0.8110466819558051"},"_hasShrinkwrap":false},"1.0.0-beta.7":{"name":"type-mongodb","version":"1.0.0-beta.7","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.7","dist":{"shasum":"4521c53f270114ed8bc8bb606f7baf5838baa756","integrity":"sha512-3Kzyl8Yx7+v83icG2ZGnGW46Kb5P3+sSZ+ORuCaO+ik/uwgUd37hb71SC+BJQpr7jRk7nHUyYir1q8khPQJONQ==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.7.tgz","fileCount":146,"unpackedSize":217616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/5QrCRA9TVsSAnZWagAAzscP/35X9r5daSXMNGFV91LJ\nDJ/IbBq4G7NJCJ8dw1eeg4i68jznIoOmlU6yZe+0Gjo/esudF8s3qn9ygeBI\nTGSiOuQ7v8xoCqdJ2AKsGer2O/hn54EWYgyVNo/sw9kRRKzObt0J2w5qvyal\nLF7Ke0fGzFvuDl8YmQfaOrCpuyi8P4USZHClknSNGYiFXIN252r10VL07fyo\nfFddSxm14css+HDn2zd1lzP18jo0d8TE/8xs30H62+UA0xR8EMdrdSZ5IUEZ\nBGgOlTmPeqc6yl5Fz6PMu0YDMrXIusmWdYzfU+3/nge3toaiDU/JvH+10+1H\nfW5Ayb8Z+LNQGte7pTu3anFBN52IIO2w9oafcR6yd7kFEVEyJnp6mJFtX8NH\nyUtqmB5KJy3qZ47X5KsHEPxX6oGlSmusVEWtMhDPSf8yjegYSHLIStALOzHd\nVmxPeqHbMWiKb/PE2dUOp/PmEDnVHAyM7siTSDtdDrMxySganfMAiTSJd43L\n6xwB4915zK2h0E2e/aLGAwVjzxTPTJZxdRg4R6xobjXYvGJYDcXbXwYS+ZOO\nN1fzprJRHr8LqEZLE1UoFGqKAFS5epRgiFefcHtR3MKiFC0DYUSSpvt4m0U8\nR+xEbxmuaP6cZlR/8qOBNMP5WFTED1K3FKWOLyDyliNPRgJa4zQ2Wei6KyB4\nukzI\r\n=GRfx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAuKt2CTAosSSYDIBf+uCi0a+3g79ZURrLMdLcI+hH6AiA69a472sVgKhMh/WhucuFNcBRzzve4OLxjvOS6+nKiqg=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.7_1610585131068_0.10378553457614026"},"_hasShrinkwrap":false},"1.0.0-beta.8":{"name":"type-mongodb","version":"1.0.0-beta.8","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.8","dist":{"shasum":"bfee17cad703da12c2882492c2716dd6ba66efc9","integrity":"sha512-JtSGoQeQ/1AyOpjXl9YLlhZBG3Trc/avAaBh7S7JLXcrpHmOvZnCJzpRym2ici2KzkLciaWh1rMVXpksRW0D6A==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.8.tgz","fileCount":134,"unpackedSize":222103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBhezCRA9TVsSAnZWagAAgfUP/00e0zIkJSNzeLeGDOJg\nCGyU5ElpiXLXN6vF3Hw6tUPphdyg2JfAn/3JYCEZO07eD2vOfkGc/NivPHiE\n2SyT1lcK041CjVPajbdMdH3Rx5WRX5aNANeHA8xOBxjXD/BfS4Qeg4/9MqqA\noyQ1T6qdCDHiW+/eU32xVRaBy0CHgiJwBqlrPFZrTOW0XDvvpAKqOpGr3Hfl\nMiMk/x3oQP2yzeS1W7bHViFsNuCu5InwUJ6AUSMNaeMD7hRegr2jJq8EGygx\n7f6nP10dst3f33P0YEHzwDSAAQcx63ZruJ5PxBwMGr3DQIMGkUzJNS0ZUNk+\nwwLec+2S9sl+tI6DbU6BWPKapRC5e/TLY2S7a33xtGE5HOvmqhY5M+UtU7mp\nha7BVZMYisIZg5XiYSeQ08YlY+P7HOgGK4otOGbzi8zRBER0BeBP8krym9re\n3C+D1ldYlWDoBUW40/lrpqTXbQ/DRxIG/MTWmxkaf9X3XRuNNB8hbaadWHGN\nn5Za0JA4xCricMP8FXCyQuXvrUvV1NZzraMusqrR2UAYEfdgeXypPrDK0BNz\nntZbpkHA8B8pslG+GvL1CGPKQTJX3Ktd5ikzVj8zO4ZYCmMUnX762O4vo0zK\nqLTyRTzJFPrkiHMT8zGX+v96M/gyzfFFS9Ldi2S4sEBRiTMAovWLS2cMsA70\n2T99\r\n=q1P0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJOyJP/bahx3jUiZ6LQh4QS3WaPCGToO1/UDmZYmJkRQIgJ2ryqd0AxLWYqgqT2PuSDujy/7ZE7jHGdUzYz45LEJs="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.8_1611012018601_0.005398071005341176"},"_hasShrinkwrap":false},"1.0.0-beta.9":{"name":"type-mongodb","version":"1.0.0-beta.9","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.9","dist":{"shasum":"a7a78476405854323b63c27e5e7dec44fccab730","integrity":"sha512-rBnKOzoazv/ZfB2nQyO+Tf6zbACGJolEziBX99ekCrmVPaLfNTbDdwD8ajE/P5xu+3ntOfxLjymZ1yXE+ZxsgQ==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.9.tgz","fileCount":134,"unpackedSize":227092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCMfJCRA9TVsSAnZWagAA+DoP/2lcG/pVa1oRmVFYCt9s\nwqYhyYy8/5P8GpEG7Nqas9ddER/dojAXz25PzEp/lwP8n6urBDpA2Y6NFiU8\n6cbl77fXX2z7IwnZP/9unlDni3WWLd/Gup4VJEIEOrL0oC/ikmlqKDAL+HNI\n/0zt96NcOPJOv5pJwk/5YzI7tfhLnPrfTAAmcndNgLFAOhjQp2PhUT/PAQbu\nQgQHLYU5OddUKseotWAwrIMvyux8UJ+xB4/mwC5ezzjyPxzQkd5LLGiU7GW0\naUnAycD+c9DWgToi4fU946cCYhuYqdvwyH7SIO4gUTjBswN9B1o6BHFlFaG/\nn30pRsUeG5iq+YYcGmgy2cKIIiBMvQ3FnzshRJu8tnHV8IXoQIz1gKYl+R3X\n285nNaRfUwVlDzZH08SZaxNR9DRn4oAwjiIoUUEgxBimOFzsJbsjdBqUR/V4\n5/ndKc+gdP4t80oYgeg1jt6PuRGRtpo+hZX81bD+v6qCu1PQg9rqijVgm20c\nTpRJZHWxYcV2+2bZkvgX7YwhmJ/YGE+gHaJ4BNBkwtOcJ4NlAtUdT4oHyDnd\nrRT3U10j0P3a4Dj8VkI4KWZNPbAlfnGChTK7l8pSMfwhlsU+wcJpJ9hunkzw\n+GiVwFDsSILND50IsZ++4evGrTj3qi6wdxPbFXjBH5QJ/rxLEAy+VOtq3lZD\nESrK\r\n=iE2D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsv1gwHurWKYxX5urnSoXEDGFGC3bXZRtPLTebqLWatAiEAqqv+0rpiQ5RkgJiFdcStn/KhDBvK9dfB7JVoUiEkzHY="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.9_1611188169322_0.8761628472277005"},"_hasShrinkwrap":false},"1.0.0-beta.10":{"name":"type-mongodb","version":"1.0.0-beta.10","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"ISC","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"dependencies":{"uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"_id":"type-mongodb@1.0.0-beta.10","dist":{"shasum":"21720089de7e6814193a3db3ae45994af685d3c2","integrity":"sha512-zwN7SUbCyE8YzspO14Q9MJcmDcMWz/u276wkASEKTVafhK/FrTJvCDFnjPyWJ0D/PBjfQN9sQDLILcRInitiLg==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.10.tgz","fileCount":134,"unpackedSize":228016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdY2CRA9TVsSAnZWagAARWcP/23lfpqFouGmmP1m7qQc\njjuiDdo6TLsw06/br+hq3tzcaIzbAkMleLUU1tGjJG2fmfiUXvOn89pzIJMB\nB1mNjuKLJ9E7qagMBih1AJS1RtGn3f0rKn6SHCo5Gf/l+LBnHgCFiyWUDyT3\n6YPTuFgZ5i5aHcSmVBTXs1DMbA2NqB0Gs6ojXu8HA1eeX4if062KIH37wHbL\nFZq8fBIJfBM+zEP8T9aXSZS9BVu4vpXN6QKQNd26+Z95DUfCptZ3igYMg8jF\nSWEY24MebdCOdTEzed1yhMtrhLsOPZcoCtkz2o6oj9VZrysr+YHp9lRHxIeU\n/Je7ESB6oKqt/PXzQYqHf4OaC45bTC8qK0oXfXtZYKJXRmCytElSemWNHKbR\nAn4pHHFNI+m5uOzKy8HJVJ58FJ7vd3EvNP4aCevllMHGONWv4NHA78Ysf6IG\necBkAA0yN44fGPArxWThK64WzebqY8agC8Xr+KWHR75LUzcbBVRoY29KwqKW\nLiQF9Z4fzJHx+P4nkr31SmZmI6E1SGmgcVxumlk9buuay1ASRgXGG7jocnr6\nbt2HW4nGRD8+5ThTPNGx4tj3cUG0fYPUsl6IdWv6TgJsVIcSJOlR8cPvP/oe\n6NB7FEibwlWTdBJL5VzYfzPxnayr3/0RFpt9C3LCKqaqg6ebPkoiAyOd4woW\n5O6a\r\n=fGwQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOQnT66fN9PxUXuM0JnAURerKHnsVay3gLlmJAAjtCDAiAZV2t/pMCnGFg8msqf4E1R/7LWETmu7zkAtauonxtgsg=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.10_1611257397961_0.6354699856555464"},"_hasShrinkwrap":false},"1.0.0-beta.11":{"name":"type-mongodb","version":"1.0.0-beta.11","description":"A simple decorator based MongoDB ODM.","keywords":[],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@1.0.0-beta.11","dist":{"shasum":"b1727a1f2e43a3562d5614b0ae7c7520d713b23d","integrity":"sha512-seJveuGDzl3HiM0/ufM2jgGGqr4H85s5BXzX2jW2G4HIRQ2GgVTBIeRFguUWDJjiPKj4a4CNqU0qetUhMsIQXw==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.11.tgz","fileCount":134,"unpackedSize":228016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdnkCRA9TVsSAnZWagAAcPIP/iqQ4+L1tUwL1T+BLzLc\nRviHOSqK/foK2tfppVUkhMCVoNO4IBrCB3Ns4AOJE4NTdJID2Vf+vx7QB6cw\nCdp/meB4scsc7uQ7FKr9hFVecIqVx1U5jvcxQH02azaYdWaZIiXIjTfzPxh2\nm56ajXobhRb5WRnkWdr5digLO1AgDLCLmdU2IACZBYCt7MbrgqUloZ0F+TEj\nkt0+tESYDEwuRAxiUPbz+1ojYE+GOFLEi+ge9jGeHO3M2zm0x+ZkpBzQ5LM6\n2Lxeka+rznghYrrdhpkkiW5uynC4LIlQJAXwXEvCLK3zHhodoWmUzO8M/ATn\nzXtS7f5owlG6AN6flc/pJk9Fe6knbSOCnMG8MuILp/gP19qYtKp3rwccIOal\n5IiSInxKOAjfoCIUmqKozi5dcYMrU+SVeHhdACLhJoGtEy/2fw1AErTiblNn\nlgOJDkPxISXUTIVHmy6zCxtBo58ydAaN9MtgIaH4i/poKbIfGeu5F4N4DpT6\ngbVNv4FlwNcrZewbLsmJmybjlQNaQ7VpXb3weC5fPcXbj8lHe/ugRAf5PPyd\n3UEEMSLI/vjfXPC1Rw6g7Jg4Qh4nQhq3cmHU7Iyw6jatKx71+isV25lpRyEa\nDm1cT05PEQUvfXwf1693PaHFdGy+0QM+iHOkRnlcWkoXAqBj3dMogs/we5H9\nRu9d\r\n=T2Kg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHj6V6FpUDqjdPKSMAvTLU7oQStnjrYXZgEQ+YjEyS2wAiB9fNHjDS6I0OdxVUpzdoCd2pwH40VNymV8QKoUgf5Hkw=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.11_1611258340041_0.10851667667478049"},"_hasShrinkwrap":false},"1.0.0-beta.12":{"name":"type-mongodb","version":"1.0.0-beta.12","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"https://github.com/j/type-mongodb"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","ts-jest":"^26.1.1","typescript":"^3.9.5"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"_id":"type-mongodb@1.0.0-beta.12","dist":{"shasum":"29025539ab7d6c7bb67a2116f4c9074db07e5b0c","integrity":"sha512-Fvlrf9QyrfNZTH3AzAD9Mj46EL29SPa7GcoQmJNlzwL1ZFdsv2tXFEFXtUAUOR3L24Ce7SfXwQBkr7vX1H9OYQ==","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.12.tgz","fileCount":134,"unpackedSize":228231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCd3fCRA9TVsSAnZWagAAoRUP/ieusRCnD7OP5KK1XQOA\nvSuG3vCh/DhGQ229Cd/8kYkNSEu3XaampO9Nu6C1L+RPSXx4cABAmO2lPpHa\nkTLO0nAnVxP+NLN5Hx38d+bjL4bwQg8qTEb7svy6jQcdwOCvs7y3q7nBiCZP\nUMbzQu6ZTPNjByhLEWvgDHbZlHvZYEFxw7Ru7B1qAGW+pg5aV3GCa8QmOqav\nwDb7GRoKqBhR7EzNRq4l9jlTni5ue26ZvlZbco9fKWvcRSDO08I59ntFZrnT\nyZ3U1HHX1Bq0etzVjPBTL9eCxRZ9NfC7l9cbeKoPHL3scGvkqPq3yAHMMRua\n8iGryzjQ16SdrDa66eWQoe3RK3whuQl5jbDeN/Ms6vY1zq6hKLBCIi/9/Gth\n+pHEG0m3PAt6tdSNh0CD/KKZVdFhQZk6rM7pAG4a0oH7dALlvdMlGFywqSCF\nOSnqt0YOuRVd+wcJCZysrAr+5x49qEWRE+G4zsMSG9VjTWQlbbW0o1QsMvlD\nQGmjBq7TGnEjzayOe9mu/UpdQ8j7u7grApuADuVIm2LGCP57dJZGLIDk+Jcc\nGvWMCrh33Jr0cqfskUjdOwCiHc2HNJex3zt8e9Odkr2Q+Est3TixKD8qrFTO\nh0mIZ8XFBnpNmAOKkwqgmaGsDeOEHLvfdtxyAjlCrxoamZpwVtOyfGy6c3WZ\no37o\r\n=+8NK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5M1vMYaEbbz/7Fwft/lr8o7FteF6MJc/ytBaU4E2NgAiBYF8TzhR2v2DlX7y1JIogBpltnw6LtYCXVGlSferHMEw=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.12_1611259359172_0.8989018810552043"},"_hasShrinkwrap":false},"1.0.0-beta.13":{"name":"type-mongodb","version":"1.0.0-beta.13","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.2.2","ts-jest":"^26.1.1","typescript":"^3.9.5","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"db6574ea348ec31fe234600d045e9b41437f5d8e","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@1.0.0-beta.13","_nodeVersion":"14.14.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8istn74yF4ImyBlbcSOuYNuoWXZDAiNDWRDbpTWEW2shBRWFaPYlEBOSJg5vOTSL7CABV3Ge1m/PPXU48EJXoQ==","shasum":"f156516dbca255aab10912c60b232b522439637b","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.13.tgz","fileCount":122,"unpackedSize":228351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEKG4CRA9TVsSAnZWagAAChEP+gKIWC47l7zsHRsHxAFC\nrxGLE4bOiOsMka9AMBTl75Y+3nLVV/6AsmxiFqKL1aQyeOQl/rH3d0DReDdb\nbBiDoi2a0/P15ENBN0u2IQ9K6tgB5CoIDCfJN6Jod2oDCNVeAmSX6Ngf4+tj\n+ta5EmPbLt7K5i+S930lXzjVlN7FPpF76CKSt4Cw8bwF9F21MPCOExVVwpAt\nIGQ3CJwf/EnEajEReBi6W6EXk2CIbYs1wl6DF/N+fXKTcJGbe4Xg1ZngFa+f\nTMmflXmK9SDPY5yHrR8KyyDoj49KD/rs8f81IvvihONUwlBmGK84vnE+EcPN\nlvsVfsedgtIsT3IsrwHX009nluuVLMxdScTN7PQnhMhJu5aoMtkwjZWamlYS\nWo13nyHJ0Z3/qG3hLTKhyzAafbiVFIIxV+ARv630jGzaFXDr15SbUOafLK4t\nSb4N/3k2DYMWMfICORDGt+f54GU8gfbLJNQiC3DInYEWQ/y0SYNudRDT4yyf\nZAn6BD629EHHM0Vtmckt/Q+RucnWvDFLck1947Mr2RguPBPEYSmqssPoknDT\nuzogVgKpvQ3v2VKxk+4/xWvrRaadXU7iGAntCBKN/gociUddJ6FFDGkum707\nO4c/MW/t4h2JO2NFhaNcVz6Lc9h7/SrW4pHN3AbTYg/uEPOhHFHCrybR+SDw\nKpWb\r\n=kumW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEhVpsszPqfmTfu1V6kcUEYoBhhs9HN1SWthWfKuvoESAiBieWRRv9lnvbKSd31CdktEnBKzt5I+3LAoUF7uVEwefg=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.13_1611702712582_0.9103516110684051"},"_hasShrinkwrap":false},"1.0.0-beta.14":{"name":"type-mongodb","version":"1.0.0-beta.14","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.2.2","ts-jest":"^26.1.1","typescript":"^3.9.5","uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"9e641be4d0bba77c8be3c42de0a0f1665b1ad09f","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@1.0.0-beta.14","_nodeVersion":"14.14.0","_npmVersion":"7.5.6","dist":{"integrity":"sha512-MjBsU9TzS5AY4dyFJnEEj7aV2tA5fKiMBRrfEZQ2lT/fVG1wCpgPHoh31aCnFbZfOXJwkwZQXv5XiBsZsolVoA==","shasum":"2a36aad3665ab07e63ed27e1fdd07f4cd712ac66","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.14.tgz","fileCount":142,"unpackedSize":250757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNUbcCRA9TVsSAnZWagAAqQQQAI8ndXLyPkz3AMExm6y/\n/cRzgjKSlRm37UUFCfC+QNvXVs+VVDjmZAXaCZwdxrNwO42XZCQBhd1Xw6so\nQTPynCfMjl5NTwbRkP5vENg5/RV9WLt/8R8FftmXOI13NeFB7wmG4TVzPY1h\n6Gy8fsmb66IRFRbbONjcI+aZh01RNjXB7OwcbYH+Uo/+wIO0ES3cc+klxloa\n86phjUoeB2yKEj/mq97higGfHOp5SqHGbtpRo47VL+lvUBkSXlRe5SDd2NYS\nruBV9v0mPyzHc3Vk5Ka2E0iAwmhTiTkpMJin7lNazyXcNlorklneycBupQsr\nGZN88flZjTl0lbtzc7MMx+ozCpv8iZmds7LyIyC0tV6N3DnRmscOwWtJfYGi\nyFnPex6pCsGXYu4PNt5S+ydKhj/mJiMHIB3XTFPAhgT3K/LQdnjeU2kqk7bT\nkNsi8ivMEqGzsR1sa/7P1y1s+eutuE5Vg0QI/g0euIPlFIH81CGu3JHkCOOl\nhKTvYxgE+H9TjpboX0FMTcV2QU0S8i6DaYQQeRoHrG9xL/C+t2ZD1solkj0X\nLZ9l7s2UjG7Soi+GfwWnu4OK3CXf5wcREvhVHDF2TCaTX50M4CGLg+fknriM\nRDg3UBZdmj+CLJdHgtsEzJ01XmjUyykoZVdHMMf/H9lnM2s2HuIMh8gt70rB\npr8Q\r\n=ZVw3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnZ24jUOUTvSIO3b1FwA8aFXGttHkos6ZNsc3jgkJKLgIhANnNPiCJYY6NRcGawDqoJF/IyNTYlL/yDmT5rpOjeN6y"}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.14_1614104283919_0.12567951238158903"},"_hasShrinkwrap":false},"1.0.0-beta.15":{"name":"type-mongodb","version":"1.0.0-beta.15","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/mongodb":"3.5.25","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"3.x.x","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.2.2","ts-jest":"^26.1.1","typescript":"^3.9.5","uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"3.x.x","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"4362b42675f76d90f079ed3b71a79e82fabee640","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@1.0.0-beta.15","_nodeVersion":"14.14.0","_npmVersion":"7.5.6","dist":{"integrity":"sha512-mWwIoTcj/8X5Dng63VQC3uzZQatbt68YRdIopiRYs9nFllMFdbifPthMWcoDh2vaHe8w8eXHID2pmzt7esWbHA==","shasum":"e196063436a7d881aedd13db3c72913ebde78bb7","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-1.0.0-beta.15.tgz","fileCount":142,"unpackedSize":252645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNZ7MCRA9TVsSAnZWagAA/MEQAJsMLJ9bUvDuWx/bKmew\nLjDVoj3cSPlars+pvMnucl7C9HNl0c6+s03D8aXsvrGXSn9oBRligxWEcrGS\nbOYfpV8riwgcWQmPUhJWExzxFOtH79iz4xq0mcrISMRW747p7dr1LTBDPrry\nnVY5lbhxkW1451N8+BwXOPIGJqneIbQ4T3XHl7PhZ0o1TcivqtgwHc+OvQA6\nhzBEIPqHjKPz+fuN8Y4QrV5wPZmOPbB2lgRyLF54hcuyB3lSPVCsykVJZV2F\nRUUpg/xhYzCFc3IJlnLpqehUnnfkNWM4Z/Ld0wbbRnQ9GLg6bZPnMNbKs67X\nMGC6Zb+Yv8FIIPOP63cVWOpOj9tLbfXPnpenqmuFBY0SCK8i3W8pMbd3UMw8\nMfFEMIA4VAQJFK5Yc4I7IV3qNSncSRcgB0EDPdqpx50aZvX9vmosE1P3tmvh\n8MW9v2lD8bRyLe3qO8fpNoyX0fu9FFvNk+PEqJIF/M7LDpvEoHz7KUK3rd+M\nUSqWTCNHRrXZe4P/ZNlTd9yeMx+j+qq5Oxwch5hU7HPj7312CJ9yJMkM4WG0\n8lHjFMlzXqS7VHeFW9THdVXi7cspYb0uTi2qWass7C2B6Rj14TCZvYozta7f\nDabpjuHnYe5FFXupmsIVhQ8u74QWd+a61raoZMtxt6nWQqvQ1GgVXtuKkOBN\nYLeb\r\n=1kU1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCruXbyB/6edHkSleIg7sOQ4D03rNoYbxYWxxED34K+hwIhAJR/58adYlnma7Kwui/xoU7q1QpchWSjtUMQFaTroq+C"}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_1.0.0-beta.15_1614126795937_0.651071699159897"},"_hasShrinkwrap":false},"2.0.0-beta.0":{"name":"type-mongodb","version":"2.0.0-beta.0","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.2.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"13c8cc6037fd40cd06c48c97978d5c8c4a7498fe","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.0","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-6cuBwKKnk/JqjgxwnRrAvooadzRGULhWkLDsmK5sf6Ri12pYZ+DDYvjuFBAPWBp9nuvpIi5WrmPnS7nZtmitYg==","shasum":"a6fedeca4bec18bd65c9ca9ed037d3ae25f2753a","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.0.tgz","fileCount":142,"unpackedSize":250959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpXORCRA9TVsSAnZWagAAGVwP/0lrrAiTEu7R8Gkc5zqj\nCEotSCO+/vPCXV6qdo5lhHvb2NivK9FuowO5LEYJ8eWM1lHl939tL19W6Tcx\nOZ9xsR33N5oYQhYUQ/SzkTBh87cnjyYwtWk2Vl0Wj1ZjKVNvkYXlec9Vvw5y\nC9j3KkXN/GqIms5iQsD1NU3SN6Xp8TFUuvaDKiIMW5hBlbBPnR3GmEr5bK33\nMqW6NLjnetG6qjMKaQUR/F5hFd+kKl/gPGSVa5IHRhppSlq5zI/r04b+E4GG\n6Zz1fQwf8bnBIZVINUq1Z7rKFYf2hg8e31crDH6T93LS5N88lLMtduh3ZEHH\nA5ZNhBwVQwMyeLE/PwD4BUBhzHHjevUzTmicB0VKc9K7M6c+nUVSoO4ixu65\nR+C1AieGB786ddKk0msAtb/0Vg2GOhqGlVBNdiD1KOWiel8vYYavyZ2+ZGDG\n4uOO43xKObGPRoAtiYKNuaYy/0AnTqu64XOq4V7szFl3z6fj5jGm0hEu2Joi\nhHgu9AA8H4G6C5oaZhF1g0WwQsXCPVUsW/sjZggjUB+IAkNNW8VX+jwfE6GP\n3O2ESZG6xnSMfMfKjV43ELoz9X1T9hH2/jm+4HAh+6/uXxmGIZM7T8HarcPB\n0Iq36RS1KHB2K+t7ReiZ4EGyXKchtz92Hu/5SjQLcjG3+b8XIUo7kD40lWKv\nf8iM\r\n=Spen\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICVOONM6VOBC3HYeL7bJ3jtvJHaHbA5ZEw96BisakqsQAiEA2KjigkQ6HPSEaAqKwIP4Ms0hC3cZ+LRgehQjrw+tLq0="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.0_1621455760471_0.47814245779365017"},"_hasShrinkwrap":false},"2.0.0-beta.1":{"name":"type-mongodb","version":"2.0.0-beta.1","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.2.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.4","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"c9ba8a76a96f4139d22914fe169b432a922237dd","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.1","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-as62Xf/l4HgLKcBgvagzxcQveZG2OH/LfXmhWJIrimREeN4lYCxi8eDGm56tRVPWSIMTaBgbFgIpXmFqlOtGpA==","shasum":"5ca3c5b0601d9d289416469ef3c36bd7cdfa606b","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.1.tgz","fileCount":142,"unpackedSize":250973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpXRjCRA9TVsSAnZWagAAezMP/0QgFUphd5Dmm+hFobY3\nlO6Hcq6Cv7g8l5M1Q+JpGwggnCw7AC6r+F64LFvM9nKYCOMwnrkWR6VAMiG3\ngmpXsmK/Xvo2SggI8o+OJQXQBICgAtx5inKGfRTbfvV0AeiCuGjnG1+Oo1Cb\nQE50IhjWhJ3OyS/Kwh1mzGZbUShKmVinHjk+OOrJ6hxs2iGjGGPt736UhNDH\nsED3cUGFK4tC88DMQiw0TppVMhY6+J2qAfepomD0se1613sa3IzEaACHrGCr\nF4lN8410spAAc5nOZzfcLpYzrqzuLFOekJboiUT81Z2ZAtqZmuTmdI9D9sz9\nMRRBGhgHLDvKaENzNYMoidLWFPRc+H0XQLlWdzoUm9TbNwo7Uoe6209tn3Rx\n8dVx0TMUzYRb4FLazNSKuCmCFsH0O824bLBYKVu8Gowsg7sC8VxulNRYDqLl\njGlzNZz0IqHDVjl78woiIeKUIERV3wD1KSyEOJNbihnE4U4fdUDKDwagNLav\nhwvw9kNB4nLEPFSECDVbUyApaenvDcojYwR7EiJfC0RIYw75cAIWZp54T0XN\nw4ufANb5r/SlN1AH+VEboCBqU3xZAxe6d1IVi7aLJ+ZuEDHQ4VcBNIIKdsC0\nI1YQm9B8I8Wx/v5JaHF2aLDV2Bbc9u0GJZjS77ihTGoUXWpxxOHp8dkHOVjq\nximi\r\n=Vfpi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBZab1Tjly2Y7baDCmZ8FVrfGdH8A6imkq+YuwYeTrlIAiEAjBf1o8V0mgmU2JgvaDLLuSbrAConCWpSiBg4L9gcAFo="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.1_1621455970856_0.5722977355795269"},"_hasShrinkwrap":false},"2.0.0-beta.2":{"name":"type-mongodb","version":"2.0.0-beta.2","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc -b . --force","clean":"rimraf lib","watch":"tsc -w","prepublishOnly":"yarn clean && yarn build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.0.x mongodb-runner start --topology=replicaset --name=test --port=31000","mongo-stop":"mongodb-runner stop --topology=replicaset --name=test","test":"jest --runInBand --verbose --coverage","pretest:ci":"yarn mongo-start","test:ci":"yarn mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"yarn mongo-stop","pretty":"prettier '{src,tests}/**/*.ts' --write"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","benchmark":"^2.1.4","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.2.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2","uuid-mongodb":"^2.4.1"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.4","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"4008bb91b9190a2d5f57178e03baf30808de45d9","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.2","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-yGEARVjddoPViS7papa28YYUaIsjeTezLMkgStJoO/FK4AEvVtwyI4s8NB4rymwuU/bOmWayrrirJpc1KjeYGg==","shasum":"5363e79920484b3f994c7d7fea02dd708cf08e63","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.2.tgz","fileCount":142,"unpackedSize":251554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpXbbCRA9TVsSAnZWagAAuOgP/3xY44BxICzscwlb40E6\ns/7i/NkGEKcjHq1WFPORPDlBeWm/wGvPOnAQWP8rdhe6qAjCKIgXAnuBrNvL\nbErFCrZGEAxAlvnOsD9cH0taSyux23wqaE/Qly+WFn9mteyv2tMbo/zDKgEG\n9aufh0XPVYaaqPZsWkbo3IhwgB4O3t0kjTTnnsjVksVzZ6A0v8FvwBYYFa9P\nDyVZBOstQvi/BRAo0kU5waf0QA7aUP9Ml/ro2o6lfxX7YGMM9Ub/YmSxErGx\nesA91rJqONatesgSPgku0dDZnYu/TIbr3WDivN2uF5eEPijVg9c8q4xl1fo0\nTIbWeQyvRjgg2EjbhzZlD4e2JneRzOMsy3vk+vkXycWMe1F3ZdxM3P1Zo4k7\ncMysB8o2F4EeIRu/bkvZEwJzQBhIDzHxvPUdhwcdiyRN4M1bB0gd5LsclCf9\nzYZUDbGUlqnRjiMMtdKFu2hrF+AGOQB7Wpua+3heCyuQZ5zWMR9rPNoMVLVh\nHAotvf35Mt7R+6cYacRxiYlWj2/q33czDoYbDUp8owxg4EP0VeBUqbx8T9YU\nVNmcGDUhfEhqnGA8GvWx62M/A9LJ6/3FluvM7eF/HxItmszuDEhj+mbuIYeX\nWAbIGdgTyP0zT2spS9aFXJFYzWfClsePnQcYQJ9WVgRTTCmcjE1OprQB/I22\npSk7\r\n=OJr5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDt1h9xHj57Sy7vPR5aB+pYiplR6tEgqp3+4T7BV/tCYAiEA0IRH6RtJ6+1WaDzv3BVjInvoc8Wu68i/aUwSBVAz9/k="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.2_1621456602699_0.3696593724515762"},"_hasShrinkwrap":false},"2.0.0-beta.3":{"name":"type-mongodb","version":"2.0.0-beta.3","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"dbded46d97b3a8cd0b36242cfa4908b5aed4c166","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.3","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-AuT2rpm71+iZ67HLrpOluLDcn2SKpYF0jJPoQEl5z9Cc1Ymk5uy1u9ym0OHSkIUOdotbIgslNCvSNul+9v1zQw==","shasum":"717721eb2e18114f073c1ae010884ce44aefad3c","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.3.tgz","fileCount":92,"unpackedSize":150989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtoqwCRA9TVsSAnZWagAAVsQQAJBCkSt+wRUISHgBGdfg\ncfxTikohqR1FHlMe7qW7xosgqrAT0YgYIhG7ai3RAdgvMpbRf6n4NdX74Dlo\nayoYVwe8Oj+lmp7U2HpVQdY9is2Stv9dHs5jgWSEQY4/zDY3ZaOxJxo9/yQC\nuia8QpGucDE3kxg9W9sKSpkm9r5MafX1rsOs9OTwIfdadRe2cWm6Tn/6/3Tm\nrRUYfSwF5Ym4DObewUChpcekLKeNtVO/QYzyto4GqrtS6RAVkwa4yr1ymf6f\nJPC0WPhOD3m8LkAbapWnic2r2mYTnAH6TnUc98Zi6uhTi9g6zzqC9DPSHqLe\nxo3W0Mbk82LAtPqYhX+tjapErY7nmUC4G9eyNvMIK6UwFvTDeg1KSrTiA9gG\nONsJhMKLAoU3iaw51NgCiEzKDpGkmOBMBklrk7z38DUiGShVa3dUpJtcgJSd\nvyOZDkZZ3aRRRNP2Pw8m1r5DC3P3bwsgVb1P1tS7EG6hUQJTMsynY58w4Tq8\n7xflGMCpMu+arnNmJVsN0GR1xZbHBFc6jlbrp62Q9RTizBHRGdQjcTdHCzCw\nXSc3VDreeH+B/sfBSxC6Ta8XfNRc9ik2SQ78sY8o6Z7LYZmxyxFN9VuLUG8n\nF7aex8qAhNvR7zFcm7lOlzwgOabErsqqMONI4+O2mrVkJgDdBJcbNFGSSZAX\nXKHx\r\n=bEP6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/usUjo2Zt5QpVV0V+3/9+6b3/Ww2elKXFdV8ikEqJZQIgFiE1+LcYHWKR5i7HBejQl4eA/IxyVWXG48vwGCmyBPw="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.3_1622575792310_0.1114482074295371"},"_hasShrinkwrap":false},"2.0.0-beta.4":{"name":"type-mongodb","version":"2.0.0-beta.4","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"b80a13d005c91aa4d60dc9a79347a13fb1fdfd73","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.4","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-M8vSpom5ycEREhGMZAwhaKfgjU3mG9cfOqWLnCR+kffBHHww/vhglgG6Qv8Zn2OBoMVR3NPzEBtVAnsZbO0zWw==","shasum":"94b80626c31c85a003eab02beda03c99a12477a5","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.4.tgz","fileCount":92,"unpackedSize":151064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgto34CRA9TVsSAnZWagAAizYP/ikw/5dNf8SPAeinUCA4\nh6Y81191DicWvNh5VyjbqGLqY1eeY+nyisQKmkICgBN4ZRLJhudlmXB48m32\n6gwREdLhWNRQm08eMaiQoRVxPMsf+unkwDXrmBt3Up4rpO7ot/nXsPD0Ofkt\nrwmGTICzUcqJ2EAur4J6T6eGg8+2aPOB0jHgZZZoOfvRqsj/ZSwgv2Hk+MGW\nvjyPDWXSdZ88rkMLDQz6xdoy+4ikgUcXqLnYlNxKU3+GBf08/VJrTOXTH/y3\nU/BH2MxWUEjllM+NFD20PiOrNKH59MAzsWW0mwkWl9w6JoLW1R0QSpwGkXhI\nsSSXmONfrwpaPWaAFh6L3U1opBo9rqVe4asP/XwWIBPxs4cOttauNQWKtcIq\nbBJn3FNZXo1TgPT/Tzne3qN6s2VxmScdIkGJsqzSPcSYqJfi2J9evCkz20lo\njlDP9Un3HeIkO6h+GwWLYuo556/ouXAgEkCfyY/BfudUO2ucnMRjXyLYfzp1\no8fh9ULGRKJZIPGWlT5HVFX7sp0m1FvrFoygKdDPUFKo/puvH7UD1A1rExn2\nOcpfTHDVVFn1+1jbLD7UGDrz0vkdsdPgPr09w4qKEM4IDMHsOjq4i1tY5rEJ\nOFd+a0tBff0EZhI59vThlAl2og7ksEqMlh/B5X25fTWDcARtkdmpv4m01J0u\nkeI/\r\n=T4mL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCB8B3H/PLzW8tbtgUbPyZjG2ydiGNP1R8TVsHgqhV1rwIgdXpqYboznfGEtmn1uLIKUnn6Mf6Gd8nsF6261BgzfIs="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.4_1622576632065_0.8278734710295952"},"_hasShrinkwrap":false},"2.0.0-beta.5":{"name":"type-mongodb","version":"2.0.0-beta.5","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset --purge=false","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"963580edb7b85184da26bf7920f96d3a0bf4683a","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.5","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-Lc6JeZAOnkffa14xntRKWAJqhTqinLvb1wNNKJegA8xi/6br1pwJR8bTYO45okq11DItp3KqULivJDzha9GmVg==","shasum":"dfc3f0634eb2b54f155f1e27839d9e863f1a22d9","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.5.tgz","fileCount":92,"unpackedSize":151086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtsi9CRA9TVsSAnZWagAAzkoP/3rMAOvUvVwp20NMIa+G\nBdq1bDf58rIiQSlaIrfg4kwwR+pPmGDek3QVPrMTpHCt6E3DsP8YqlIViaC8\nKdFwR8X5m5ACY8rPJLcz9tSl7UCCf3ZWIAbiHNRjOPoB4xQ2VMd0T0Rg/5OO\nAixaI3TT3X6/zPssXjDhO2xpfUlsws3GCpdIoO/gQsw92GNxRqPQTsJv7TV/\ntbL1+WWIscx9OH2WinxP6m1R3xBfQn0Dd7fBBkNC+TtRbWiDV8LD9jAFGsfF\naM7JprdkAtd7kjqDg0HcnTxt59Rl835swCQyPxtZKe0vlBw481ytdk/AlIjt\n8wfdw46I6lDuy7YI4AtElzdFnfS4vs/rcuX3rizpIDYFnC2Im1pOgQPlynlS\ngfGeCifkVubO5wRrV0ErgiFMFXrZZtOIdZ4DJD+j/vhmaMnea3Oi10+dHmBi\n7wbbVrYeI6oi+hk9AKBRtqXy6B9d+5jdfEDB4tm7YmYfyBjL7f5eqDlKsdUc\nIO1D68EufOcz5iqlsnog7ZZa0PiO3kfUBl5C5/wn9otGK4IDWLJFfC1ck2R7\nUC37RKS2tAgXAgEB0Z/oQhhBwpKVp/RaExS45hz/6Q6TNr822Hb+Ibvbhpud\nd7jbmrXe5NLcJWhC1wOg2CRItjTsN2EALuGQWhsvGC+f7MuY7D3pjDT/Fcxw\nDwAb\r\n=QC9B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiMczAZH9OVJ0cbhQkdzb0GVczvfNAoZ1JGo/FeacC5AIhAIsmz8SPvlhftqH5Mnjv3OjHCtKNKCieCfva35fQa75z"}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.5_1622591677204_0.10975357034032429"},"_hasShrinkwrap":false},"2.0.0-beta.6":{"name":"type-mongodb","version":"2.0.0-beta.6","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset --purge=false","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"889a0b1c3c9372ab764bd0346be5ef05814caee5","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.6","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-2e+F38AcUTVKF1Ayy+c6O4M29EkXTT5WXNnWZUopdPQNCfX47JkKleg8pGMgrJHQrCRuPR7SQLrh+rI3xDeqeQ==","shasum":"89d2c251b3702499d79ef1e4a57623bc3ff45e41","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.6.tgz","fileCount":95,"unpackedSize":150434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg04FFCRA9TVsSAnZWagAAAhAP/iIU2tC33cdjbPHRfFbu\nvd7Uc3rG0D2uZ7n3WzYjZWXl+ZpBcRp09Uylpla6v0NwGSCzga6kqmz46Um0\n6GsU9AoxsDL40s6UGegRNKaIIqLZj81JRAKkzwc89u6d+nPfIF4shHNopKXj\nlV0ufAbpWuyNCMV+SWk5JM1SuMsBbv5VNzemJLno1U4wSVj+avHd2PfOugfV\nhaiO3W1FUsbnPmgaDL1eU4aRqmPbzMibdJTSHjrsieTQ9A37XJQMYKe09TVC\nKlDUpZ+bWzrPStZjEx7tgoLBCAMgyRaS2wuSbSpY3+23llZIrG4IYjcjngal\nN4FnMBR3FHw90sqA3tHdfu+28aBF/bpJsBkPBdry4ENAX8exdlgJfSldAXmQ\nkaRRoGctVELr8s3ovUQ4UHbxKkmkj8jbi3hcl2Qez/v8yfrwyH97v2RcoESx\nHf4kEvrLSLwyxfu2zfFY0mhKReLVBOtLg5sGP1ycEyGpI1SJYvCGRxap09su\n+PjXDA+TU7KbCdXXn6fo2BVwwMq+VYqSNVFb4/9dGm1jfe5nv6Y5J9ocyPB9\nd42+E73xGSqu/j2giAPLKv+gY85cRc8O7j883a1RkVxtiy/5Zh8+6HVvrOfa\nZUnOgIS3ikTTTRL5Rb4jABXvLMGlxAJCTMSNtqPgTtR6fRHa0S8y/zx7yPpL\ndJzo\r\n=YTBH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHva+3CXxrvWVcZm2yAB5lw7WKLoULtbo7Y1vGPUHnIiAiEArQ8MAxyIVKmJbeoHh4rc21Blhzyoub1jfEv+WX+bfac="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.6_1624473925068_0.4989215886516818"},"_hasShrinkwrap":false},"2.0.0-beta.7":{"name":"type-mongodb","version":"2.0.0-beta.7","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset --purge=false","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"540442caaeae88c8b8589a77ad20bc435a1f807c","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.7","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-uQkxExXtIwB+FLrj12/GO1jnEwDkv37Z1/1X8y5QsMn1PIgvKDy/G9691TVzHtFQEt9zDL3lSgGNIS0m3b2XdQ==","shasum":"010658cd04cbab8b3f63a86b3d52522b8962809c","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.7.tgz","fileCount":95,"unpackedSize":152425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg04qUCRA9TVsSAnZWagAAAiYP/RMxu67xovwTVCowPVyy\nqz2sy0w6RMW0AjEzip0WYpceSzQWQOBMLT+ETBx1QZ6K1FeLRgscoNS7hAhY\n8MNAQ3lAFxfCyHlScT/s41sEPEg7YgDhAltTOHMFA9tbLOzInyunkIKnFj28\nbd4f3cge/Te8o+8w0GJvO2AAVkyKs3NKPHJAtS+I2JVWBSUDYNEMcNM7m7be\n0BVwP+YUi74tidcKx5DZlADk0tPrROYYdRxQC/EKNEQ+qrgCTP4OUd8ZkWt/\nV9VOdy3PzuyOtQI+nKXPKCsA66PWMec5ZyFibKdgVWPD8r2ZvUhGTWLEnyGa\nTRfu3UnodNCZ9mRnX9Oj7tR3Do8ZKztxoikaVZa+/n4L0TTosAwgEYnx5/qu\nX2SKYlNcEPElBLzIZ46uYfFNWVP6Gb8HUjZv9+8j2YvW3iiSa/aXUoH7J83u\nzUjlHjkErCm/xQVi1S4Q66eNIAxVMxRCUdcO1ML+HS7aJur2dcirArB5orVg\nlDwv3rPHciE7M6CIzO9XRN9drn0IK+yNk9O4DqKjcEFAWKy127tP8ze12yb4\nOyQggxNG31d9w85rjaKRhEOUDwm2W7wM10P2V4vVF1Fz9YojZHmVIecu9bF7\nkalw53m5+gZwBH5xTRXLiwCM53d1VSsHXUQgfjgVA4yWCcbpGM7gKR0U2e2f\n3iXH\r\n=y17j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6WOwn6HCUmhhShFArHZI41YcLnhPvUyMj4zTvoHaUUAiB9gqK2is3dyNCWiLjf+7e1NNYvNkmUKLEXcdwk6uEQeQ=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.7_1624476308137_0.32678527358450626"},"_hasShrinkwrap":false},"2.0.0-beta.8":{"name":"type-mongodb","version":"2.0.0-beta.8","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset --purge=false","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"40659f4600f962cade2dd9828f2bc19c2ad3cf69","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.8","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-gl02P31iNbfZi3xuq0g/0ETd8hE0sfuv+s4g1me6DXVZkZopsPlKVHZev9+j7Panl6IiwlOvWgR12VAhxo82CA==","shasum":"4a4057175a45b558d74a3958563f92ab9c11e8a1","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.8.tgz","fileCount":95,"unpackedSize":152411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg08/WCRA9TVsSAnZWagAADmAP+QEOWhanhWhkYV/jR1MI\ntwPYgEEH/vqO8uOHQ+W2SOtbdMLcNJBsC3BFQdMmSeDUWi8NV9tHGEusr7HT\nauaNcU7wIkJyHo0oLGZWuPfDBDwcCqx6WFjdv0ovl8XL95uvki+jxa/t2cCT\nnspbymV0ogONxpu5ZXWq/j4YtNJzaAD79dPgHQREn5eGnax2OYOdBbLC/Vnp\nhPa/qro6XcVdqIsiSROF7S7rLmF0erobhm5ejxOdGdM62LYkqxHpww1jT92N\nr95wCnWrsTYCtwetYw0V0iLoTodAOc1/SycHrXbHuHNoRIQue3/siMtOhak6\nZkFLoqPNq2S7frhElTndb49WLM0XzCsSLAnRp8orbKezti1BsEc6IiIdJLFf\nckWXj1LHfHovkP8V9aTEimf8PRWBBaD7kp6op1tyfeNMtVo4dNNOp6vhEnXQ\nwoHQUNzzAWqZGxoDRBoL8qwh8tNHKUaUza1otLxaEWEtj6SQDpeka34eKYI/\n38Mj/BxsS1zCaeWi1MrNS9Dr36YtcErkMWZGvmxpA1YGBfcs56WkazCoe3Fw\nXrEmc+DRBu65oPJXxet3tBhmRKwRZks7ykEbMpt+gSpHyLf8K3AUQ11QI9ni\nIw1u1zO/MWGhXteacI+Y4CQmfIQBnV5RyQD4IkRWu36LIcCCzn/AEMk7Gi8I\n6nVP\r\n=IIRb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHYagU8CuBJHoBknGv2+ZPl007DDH5OVnVqZkl/1BWTIAiBpGtZJw1xSBLew6vma4uUBQplirdh7+EpXuwMR/nEXOA=="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.8_1624494037856_0.8448610594484727"},"_hasShrinkwrap":false},"2.0.0-beta.9":{"name":"type-mongodb","version":"2.0.0-beta.9","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run clean && npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset --purge=false","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop"},"devDependencies":{"@types/jest":"^26.0.3","@types/uuid":"^8.3.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","eslint":"^7.22.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","husky":"^4.2.5","jest":"^26.1.0","mongodb":"^4.0.0-beta.4","mongodb-runner":"^4.7.2","prettier":"^2.0.5","pretty-quick":"^2.0.1","reflect-metadata":"^0.1.13","release-it":"^14.6.2","ts-jest":"^26.1.1","typescript":"^4.2.4","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.0.0-beta.5","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository<UserRepository>(User);\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"dfe0f1416bd367810caef37d25cdd4a9cb19cb93","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.9","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-g2EtFygrMeEYtUrSnb9lYo7LCM7OQd/CIxAaykIJ2GbXl359W9kjJwpaMCv/laeVdQvgU4cAE45xMzY/sEQlkg==","shasum":"b46372b42e68d6a979badc74686daed5aad81262","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.9.tgz","fileCount":95,"unpackedSize":151848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEZNzCRA9TVsSAnZWagAAdIIQAJc+ttrbHFenNptWpABz\nrUStK8jpYc9V4aXOJsDddc38uOh98cm4WpzAwm4sdq1rQ7NdjEJIr1/PNoJJ\nySgal+gXKCxWvkugSdcSGsL0r3s2iADDcrlX22IrOLU8ZezmoUG0bsaT0Jmn\nHXkpTr8AdBUv/AebE6if47JmrsWpMm3FRlDx1au/Vw2C1OtUS5X8vccX50+Y\nZZFnpua56XyGs6QHChm9EB0G5AzsEinu9xOlv4q2Daca29oTOxqwTCOON0rw\nwYjtjl7Q3Tavey/FIYOqdpeSvZqNJvBjhndIcO4wKpLmPxIjR24Y7CEMptuP\nICWLD8JSLNgDrM6c3LygWzj4ABnZw8cN3Ws5JUWqYHjy4BNDJOcZpmQj8en+\nOnaxi/JSOR/xCBj3x/Jkhm02PTEk9GsylsXMtX6nSPdoqlRwv7gOzeE8VnEl\nKX5o1RsVGCWHY6e4qx1VhlSVkwltJZqqUxXCOoG24fuba1rcQNtiHlk+fDIW\nPh3NtZyJ7v9WC4OAq2I9xJWYoAdLELax5X2YTy/V2kZKkXTvcgsbZR7fxdex\n9BNcFZ3ZDuv0uMCTQ57dz0my7iD/sOpPicdL5JXqUXSj0YHjWj14YDvyeQpn\nVDtKM5U78rDH0lyHxU9M6efMbnF6ShptvmTco/Ilvi85fYXL/eEmiu1cqkjz\nASmo\r\n=KAqC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5U8R38AMqZ6BE6QG9ehUm5QjsFH4h3AGbjB2F7kIzkAiEAjOuan19V5I8KjGIoClqQ7EHgHv/gPYMLUa9C9Y0fmf4="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.9_1628541811095_0.8080495273645951"},"_hasShrinkwrap":false},"2.0.0-beta.10":{"name":"type-mongodb","version":"2.0.0-beta.10","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"npm run clean && tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run build","release:next":"npm publish --access public --tag next","release":"release-it","mongo-start":"MONGODB_VERSION=4.x.x npx mongodb-runner start --topology=replicaset --purge=false","mongo-stop":"npx mongodb-runner stop --topology=replicaset","test":"jest --runInBand --verbose --coverage","pretest:ci":"npm run mongo-start","test:ci":"npm run mongo-start && jest --verbose --coverage --ci --forceExit --detectOpenHandles --runInBand","posttest:ci":"npm run mongo-stop","prepare":"husky install"},"devDependencies":{"@types/jest":"^27.0.1","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.1","husky":"^7.0.0","jest":"^27.0.6","mongodb":"^4.1.0","mongodb-runner":"^4.8.3","prettier":"^2.3.2","pretty-quick":"^3.1.1","reflect-metadata":"^0.1.13","release-it":"^14.11.5","ts-jest":"^27.0.5","typescript":"^4.3.5","uuid":"^8.3.2"},"optionalDependencies":{"uuid":"^8.3.2"},"peerDependencies":{"mongodb":"^4.1.0","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","globals":{"ts-jest":{"tsconfig":"tsconfig.test.json"}}},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { DocumentRepository } from 'type-mongodb';\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // for type inference when using `getRepository`\n  [DocumentRepository]: UserRepository;\n  \n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository(User); // repository typed as UserRepository\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"cfb558bcaeafad289faecb7404b3d2206099d926","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":"^8.3.2"},"_id":"type-mongodb@2.0.0-beta.10","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-Kl82j3Sfy6aqtHmLnwzqgHnF3GJje4AiYbSXKHoOGdco1e3LclqUn1phAPjLGvIFHSLtgIRSjoz0NleVK24fTQ==","shasum":"757cce437fd25211c6e04b7bc53813f9dc8b7145","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.10.tgz","fileCount":95,"unpackedSize":152319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJAheCRA9TVsSAnZWagAA/9gQAJatNsO3jYVHOotMlyau\ndpL1ur4iOAlqMsX2+E14cuyq5FZrIAF4642O7FGrb9xxLGCT3HhpzepF10kR\nRNTNyQ/Y+IlpdWqNQnNg7OueuRUTDMxDA0GT3TZ5YSMlQCQAmb8u4X6aomjL\nlxBEhEOiTWvAnrsoFPxbOVeIidDShV+Zr0AOR1UPF8q69rl3p5azJJj8yfOZ\nSN6Jx21it7nPNpPelXThlhcN0TOWmNgED7LgYtZsmBYRxl5A51OuawuZApe+\nulIWuQa+wQJrz5XD7e5ChkgRRxMzVOGJVX9TaXMPCGCQBwApxk0jRqGt/cdc\nbqSbW2HyHGaRxvH5dQ5d8aQztPLR/APc9hzf8Zy1f2NEZM+i+prSlhBXMVCB\nEeXtAGHL2B0arnHm/xBagklpdFJlvGZ7nhgNUU1OOCi8PwYnLSwqkC10QNON\nNsY4gbkTs76IWnPtlEA+rMHJ96G9nSPLvp3NQI2OO4kcdJ08OXl7kGoH3QwM\nGuAsMTBIcSUagNZCGLoSa/49PamYxfJZZwjxwMc7hTIQYPKq4T4VmR/oX1qM\nfEHDJOfxr1PqRyXOWo5DxI9H11o/+kKI/MTxzKNrn1yo/gv/lzbg3J6aCiGA\nqQpVUbdjh0/w4iWB6oQzzbqtxTMqKvQjfAaeabxg2pmZTIq9B5hPX8uZYUAg\n1RmJ\r\n=zWkk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUep2KT6xvCSd1hADNzbTsJoogKfg+daMs+bx40VgHoAiEAoXm9+Yer0Srofqy8Qind7DfDqVwEfBaUloGOBCcc4+I="}]},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.10_1629751390555_0.7796198016160569"},"_hasShrinkwrap":false},"2.0.0-beta.11":{"name":"type-mongodb","version":"2.0.0-beta.11","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"npm run clean && tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run build","release:next":"npm publish --access public --tag next","release":"release-it","test":"MONGODB_URI=mongodb://localhost:27017,localhost:27018,localhost:27019/test?replicaSet=replicaset jest --runInBand --verbose --coverage --forceExit --detectOpenHandles","test:ci":"npm run test -- --ci","prepare":"husky install"},"devDependencies":{"@types/jest":"^29.2.3","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"^5.45.0","@typescript-eslint/parser":"^5.45.0","eslint":"^8.28.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.2","jest":"^29.3.1","mongodb":"^4.12.1","mongodb-runner":"^4.9.0","prettier":"^2.8.0","pretty-quick":"^3.1.3","reflect-metadata":"^0.1.13","release-it":"^15.5.0","ts-jest":"^29.0.3","typescript":"^4.9.3","uuid":"^9.0.0"},"optionalDependencies":{"uuid":">=8.0.0"},"peerDependencies":{"mongodb":"^4.1.0","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":["ts-jest","tsconfig.test.json"]},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node"},"gitHead":"1c76d2a84db22a5cca99629ce22610b64e61f251","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":">=8.0.0"},"_id":"type-mongodb@2.0.0-beta.11","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-X7aRKiK/QzwmE1UgzjmpIqVMfq50rG0Jnl49tNPEHP//1riw+YKYxFw6h7c4Xr0F36wpNGP44vJFfzzUyEhmEw==","shasum":"2204172c4b07eefff39f632282e2011436af3627","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.11.tgz","fileCount":95,"unpackedSize":156118,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA02gxL9X0c74FbPRhDKtLlCSDl88d5HOe3EUkBftvgtAiEA2o8nmjAzxyotBWAm7UXPJkk+t2nhHixfKm/Vo0lGHSg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh+1ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWaA/5AMlwVgT/uSu/HOl1eWolZg46f6o9IjzfVg0Cbk/9BqSr141C\r\ngE6h0kJZiZEyYC+aV+KZvx98WEenfw/yUc1nvOJxkV1CiQrGHZ8JNZqK1VTL\r\n3C3Hft5W780ct9k+CyFXjKvirJBCKB/icl+bl/5qorhaWnS7HfTaQ0MQBxsC\r\nyf0gDN+4U4c9OCeQNkjT6WhUbXfLnsxSV4uR8qU0z9Okisy+mTj6/NQ4XOGT\r\nHIDbZ/63dX0Xv5b0lkalC5Ie4Ux5e6dzCHYZ4NOguh4QGwIk04VMNeEkQMNs\r\np7f7Fup9/OCsXw5K0AEHL0BroaGqbkYSnBHzX0wQmVw8HPbEdU3rkcWi1mdj\r\nTRYOKy7OyCM7H29DzEmHuEByhy120ftgYg/mvKIGnLgbZSUnSW7xeZQroE16\r\nRpmjNp09hLMyUDBulYNy2ebySdpirtj5OP1ghK4yLv+F102cH58aDbfAPl0a\r\nMCGM5amN2YD8Dx4qDALXOVOt7sJujjtuE6Zn+OsOnDIz+sxDg/KSkyeatwpI\r\nCfeGdEoug8LWciZRNLo3u0oOmbB7xfodY0a0aOaWBkwijPFJQBXjAaReg8Qw\r\n9QBUJa8Bl2Fay9pzFfS4NrhM9hjG9APA9eknRZdTFfFIZSOM8D4rj7VyfkyY\r\nGAmuxX0srlq/zWeGjLtI+IGwwgl6WhTFo6w=\r\n=YBnc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.11_1669852505372_0.17413170265439604"},"_hasShrinkwrap":false},"2.0.0-beta.12":{"name":"type-mongodb","version":"2.0.0-beta.12","description":"A simple decorator based MongoDB ODM.","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","main":"lib/index.js","typings":"lib/index.d.ts","scripts":{"build":"npm run clean && tsc --project tsconfig.build.json","clean":"rimraf lib","watch":"tsc --project tsconfig.build.json --watch","lint":"eslint \"{src,apps,libs,test}/**/*.ts\" --fix","pretty":"prettier '{src,tests}/**/*.ts' --write","prepublishOnly":"npm run build","release:next":"npm publish --access public --tag next","release":"release-it","test":"MONGODB_URI=mongodb://localhost:27017,localhost:27018,localhost:27019/test?replicaSet=replicaset jest --runInBand --verbose --coverage --forceExit --detectOpenHandles","test:ci":"npm run test -- --ci","prepare":"husky install"},"devDependencies":{"@types/jest":"^29.2.3","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"^5.45.0","@typescript-eslint/parser":"^5.45.0","eslint":"^8.28.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.2","jest":"^29.3.1","mongodb":"^4.12.1","mongodb-runner":"^4.9.0","prettier":"^2.8.0","pretty-quick":"^3.1.3","reflect-metadata":"^0.1.13","release-it":"^15.5.0","ts-jest":"^29.0.3","typescript":"^4.9.3","uuid":"^9.0.0"},"optionalDependencies":{"uuid":">=8.0.0"},"peerDependencies":{"mongodb":"^4.1.0","reflect-metadata":"^0.1.13"},"prettier":{"singleQuote":true,"trailingComma":"none"},"jest":{"moduleFileExtensions":["js","json","ts"],"testMatch":["<rootDir>/tests/**/*.test.ts"],"transform":{"^.+\\.(t|j)s$":["ts-jest","tsconfig.test.json"]},"collectCoverageFrom":["<rootDir>/src/**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node"},"readme":"<h1 align=\"center\" style=\"border-bottom: none;\">🔗 type-mongodb</h1>\n<h3 align=\"center\">A simple <a href=\"https://www.typescriptlang.org/docs/handbook/decorators.html\">@decorator</a> based <a href=\"https://www.mongodb.com/\">MongoDB</a> ODM.</h3>\n\n**type-mongodb** makes it easy to map classes to MongoDB documents and back using `@decorators`.\n\n## Features\n\n- Extremely simply `@Decorator()` based document mapping\n- Very fast 🚀! (thanks to JIT compilation)\n- RAW. MongoDB is already extremely easy to use. It's best to use the driver\n  as it's intended. No validation, no change-set tracking, no magic -- just class mapping\n- Custom Repositories\n- Event Subscribers\n- Transaction Support\n- Discriminator Mapping\n- & more!\n\n## How to use\n\n`type-orm` allows you to create a base document class for common functionality. Notice\nthat we don't enforce strict types. MongoDB is \"schema-less\", so we've decided to just\nsupport their main types and not do anything fancy. Again, we wanted to keep it as close\nto the core driver as possible.\n\n```typescript\nimport { Id, Field } from 'type-mongodb';\nimport { ObjectId } from 'mongodb';\n\nabstract class BaseDocument {\n  @Id()\n  _id: ObjectId;\n\n  get id(): string {\n    return this._id.toHexString();\n  }\n\n  @Field()\n  createdAt: Date = new Date();\n\n  @Field()\n  updatedAt: Date = new Date();\n}\n```\n\nNow create our document class with some fields.\n\n```typescript\nimport { Document, Field } from 'type-mongodb';\nimport { BaseDocument, Address, Pet } from './models';\n\n@Document()\nclass User extends BaseDocument {\n  @Field()\n  name: string;\n\n  @Field(() => Address)\n  address: Address; // single embedded document\n\n  @Field(() => [Address])\n  addresses: Address[] = []; // array of embedded documents\n\n  @Field(() => [Pet])\n  pets: Pet[] = []; // array of discriminator mapped documents\n\n  @Field(() => [Pet])\n  favoritePet: Pet = []; // single discriminator mapped document\n}\n```\n\nAnd here's the embedded `Address` document.\n\n```typescript\nimport { Field } from 'type-mongodb';\n\nclass Address {\n  @Field()\n  city: string;\n\n  @Field()\n  state: string;\n}\n```\n\n`type-mongodb` also has support for discriminator mapping (polymorphism). You do this\nby creating a base class mapped by `@Discriminator({ property: '...' })` with a `@Field()` with the\nname of the \"property\". Then decorate discriminator types with `@Discriminator({ value: '...' })`\nand `type-mongodb` takes care of the rest.\n\n```typescript\nimport { Discriminator, Field } from 'type-mongodb';\n\n@Discriminator({ property: 'type' })\nabstract class Pet {\n  @Field()\n  abstract type: string;\n\n  @Field()\n  abstract sound: string;\n\n  speak(): string {\n    return this.sound;\n  }\n}\n\n@Discriminator({ value: 'dog' })\nclass Dog extends Pet {\n  type: string = 'dog';\n  sound: string = 'ruff';\n\n  // dog specific fields & methods\n}\n\n@Discriminator({ value: 'cat' })\nclass Cat extends Pet {\n  type: string = 'cat';\n  sound: string = 'meow';\n\n  // cat specific fields & methods\n}\n```\n\nAnd now, lets see the magic!\n\n```typescript\nimport { DocumentManager } from 'type-mongodb';\nimport { User } from './models';\n\nasync () => {\n  const dm = await DocumentManager.create({\n    connection: {\n      uri: process.env.MONGO_URI,\n      database: process.env.MONGO_DB\n    },\n    documents: [User]\n  });\n\n  const repository = dm.getRepository(User);\n\n  await repository.create({\n    name: 'John Doe',\n    address: {\n      city: 'San Diego',\n      state: 'CA'\n    },\n    addresses: [\n      {\n        city: 'San Diego',\n        state: 'CA'\n      }\n    ],\n    pets: [{ type: 'dog', sound: 'ruff' }],\n    favoritePet: { type: 'dog', sound: 'ruff' }\n  });\n\n  const users = await repository.find().toArray();\n};\n```\n\nWhat about custom repositories? Well, that's easy too:\n\n```typescript\nimport { Repository } from 'type-mongodb';\nimport { User } from './models';\n\nexport class UserRepository extends Repository<User> {\n  async findJohnDoe(): Promise<User> {\n    return this.findOneOrFail({ name: 'John Doe' });\n  }\n}\n```\n\nThen register this repository with the `User` class:\n\n```typescript\nimport { DocumentRepository } from 'type-mongodb';\nimport { UserRepository } from './repositories';\n// ...\n\n@Document({ repository: () => UserRepository })\nclass User extends BaseDocument {\n  // for type inference when using `getRepository`\n  [DocumentRepository]: UserRepository;\n  \n  // ...\n}\n```\n\n... and finally, to use:\n\n```typescript\nconst repository = dm.getRepository(User); // repository typed as UserRepository\n```\n\nWhat about custom IDs? You can either create your own type that extends `Type`, or use our built-ins:\n\n```typescript\nimport { Id, Field, UUIDType } from 'type-mongodb';\n\n@Document()\nclass User {\n  @Id({ type: UUIDType })\n  _id: string;\n\n  // fields can also be a \"UUID\" type.\n  @Field({\n    type: UUIDType /* create: true (pass this to auto-generate the uuid, otherwise, omit) */\n  })\n  uuid: string;\n}\n```\n\nWhat about events? We want the base class to have createdAt and updatedAt be mapped\ncorrectly.\n\n```typescript\nimport {\n  EventSubscriber,\n  DocumentManager,\n  InsertEvent,\n  UpdateEvent\n} from 'type-mongodb';\nimport { BaseDocument } from './models';\n\nexport class TimestampableSubscriber implements EventSubscriber<BaseDocument> {\n  // Find all documents that extend BaseDocument\n  getSubscribedDocuments?(dm: DocumentManager): any[] {\n    return dm\n      .filterMetadata(\n        (meta) => meta.DocumentClass.prototype instanceof BaseDocument\n      )\n      .map((meta) => meta.DocumentClass);\n  }\n\n  beforeInsert(e: InsertEvent<BaseDocument>) {\n    if (!e.model.updatedAt) {\n      e.model.updatedAt = new Date();\n    }\n\n    if (!e.model.createdAt) {\n      e.model.createdAt = new Date();\n    }\n  }\n\n  beforeUpdate(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  beforeUpdateMany(e: UpdateEvent<BaseDocument>) {\n    this.prepareUpdate(e);\n  }\n\n  prepareUpdate(e: UpdateEvent<BaseDocument>) {\n    e.update.$set = {\n      updatedAt: new Date(),\n      ...(e.update.$set || {})\n    };\n\n    e.update.$setOnInsert = {\n      createdAt: new Date(),\n      ...(e.update.$setOnInsert || {})\n    };\n  }\n}\n```\n\n...then register TimestampableSubscriber:\n\n```typescript\nconst dm = await DocumentManager.create({\n  /// ...,\n  subscribers: [TimestampableSubscriber]\n});\n```\n\n#### Other Common Features\n\n```typescript\n// custom collection and database\n@Document({ database: 'app', collection: 'users' })\n\n// using internal hydration methods\ndm.toDB(User, user);\ndm.fromDB(User, { /* document class */ });\ndm.init(User, { /* user props */ });\ndm.merge(User, user, { /* user props */ });\n```\n\nFor more advanced usage and examples, check out the tests.\n","readmeFilename":"README.md","gitHead":"c520a8b27ba8c06f993105a1466db2ed2cf2b25d","bugs":{"url":"https://github.com/j/type-mongodb/issues"},"homepage":"https://github.com/j/type-mongodb#readme","dependencies":{"uuid":">=8.0.0"},"_id":"type-mongodb@2.0.0-beta.12","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-Xe9pPwimVAowhUJJESGsOTwAZk6cOGRtFVGRhZqaCkJUTOkSiNycIBDGiGtBgkyftFgB0J63mTLAi1+GyUXycg==","shasum":"5990eb43e881454ef89bdb7b050bb1513831a4ed","tarball":"https://registry.npmjs.org/type-mongodb/-/type-mongodb-2.0.0-beta.12.tgz","fileCount":95,"unpackedSize":156118,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEnYm4JwejzK+wlugFicFuI/GkzgT46Sci5/L92Q4c0AiBdooJu7XP0hjt2ycsRPxK8xgEkoEi2O4Qkf/vWHi2xng=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh/ITACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPdg/+NzMyoQmBD9EL1rvhKWGhCPuX6Htcik/W7jHfUxPumypP+Xie\r\nha0a/jfWgty6NkkNtktIE1ycwX4qpBOWhWisSFoGmvkLkuESGxdqF51C3/JQ\r\nubNUJoDcCQ7CJW2ldnDch1lGOnLExS34/az+7Q0EtDGHrbg2i7IfpToNcvSI\r\ndo4YmLojEwjBV7enZzq6CREMZDZYXRivBHF0ZNAp2bCDnc3jm6q1Ek4rhmyd\r\np60P+PRczTbCiQhiiijiGXsy8dsW4NU1ILY4CuizqC2Ow/zHtrksjqCAnaIc\r\nTc6rtyAXcNU535vmogXE7+LL5EO6K09+Yfv0ZHoL0r3pGkTwCR0pESfsdD1a\r\nyoLDthfAm8XBhZ+ATB77coIqIp/NOUJ7eypI49vYw0Ef3O5DbThYNUSQ3RaZ\r\nKkN3ulWunmSi7FXlfiikXBSjWMyyJrxKMjgv+CHKVbB7+1rxsNH1bQXKYO6l\r\nOHSfZX8tgWFycpTkpOjicKJEmkMqKuhvEnO8/fAJSsMQ3lzvPxJcOGu4K9bk\r\npndMNPG6ZS+yc+eM4Vy05OQKat+i1oOhQC/6J7vAuxHyilp2pG2ihPJcXuAs\r\nIMlDt2juB4yIEMgB++qcbuFbw5CzbSA+tu50pTte7empLG/p/pXJBtKvwzUh\r\n4nbKLu4EsW8jmKg6g0+n0gw9FtEbDjWA+/s=\r\n=avRf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jrdn","email":"j@jrdn.org"},"directories":{},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-mongodb_2.0.0-beta.12_1669853715265_0.689825978269569"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-19T00:37:28.665Z","0.0.0-alpha":"2019-09-19T00:37:28.797Z","modified":"2022-12-01T20:02:03.489Z","0.0.1-beta1":"2020-02-10T22:32:40.412Z","0.0.1-beta3":"2020-02-10T22:56:59.293Z","0.0.1-beta4":"2020-03-20T23:21:44.212Z","0.0.1-beta5":"2020-03-25T21:07:43.725Z","0.0.1-beta7":"2020-06-30T20:56:28.374Z","0.0.1-beta8":"2020-12-10T23:29:05.917Z","1.0.0-beta.0":"2020-12-18T00:31:03.386Z","1.0.0-beta.1":"2020-12-18T20:13:35.015Z","1.0.0-beta.2":"2020-12-19T00:57:11.032Z","1.0.0-beta.3":"2020-12-19T01:01:03.551Z","1.0.0-beta.4":"2021-01-13T22:00:45.374Z","1.0.0-beta.5":"2021-01-13T22:06:19.486Z","1.0.0-beta.6":"2021-01-13T22:54:43.727Z","1.0.0-beta.7":"2021-01-14T00:45:31.238Z","1.0.0-beta.8":"2021-01-18T23:20:18.741Z","1.0.0-beta.9":"2021-01-21T00:16:09.467Z","1.0.0-beta.10":"2021-01-21T19:29:58.141Z","1.0.0-beta.11":"2021-01-21T19:45:40.211Z","1.0.0-beta.12":"2021-01-21T20:02:39.424Z","1.0.0-beta.13":"2021-01-26T23:11:52.740Z","1.0.0-beta.14":"2021-02-23T18:18:04.115Z","1.0.0-beta.15":"2021-02-24T00:33:16.072Z","2.0.0-beta.0":"2021-05-19T20:22:40.727Z","2.0.0-beta.1":"2021-05-19T20:26:11.084Z","2.0.0-beta.2":"2021-05-19T20:36:42.961Z","2.0.0-beta.3":"2021-06-01T19:29:52.411Z","2.0.0-beta.4":"2021-06-01T19:43:52.203Z","2.0.0-beta.5":"2021-06-01T23:54:37.403Z","2.0.0-beta.6":"2021-06-23T18:45:25.211Z","2.0.0-beta.7":"2021-06-23T19:25:08.272Z","2.0.0-beta.8":"2021-06-24T00:20:37.996Z","2.0.0-beta.9":"2021-08-09T20:43:31.307Z","2.0.0-beta.10":"2021-08-23T20:43:10.700Z","2.0.0-beta.11":"2022-11-30T23:55:05.540Z","2.0.0-beta.12":"2022-12-01T00:15:15.489Z"},"maintainers":[{"name":"jrdn","email":"j@jrdn.org"}],"description":"A simple decorator based MongoDB ODM.","keywords":["orm","odm","mongo","mongodb","ts","typescript","javascript","entity","ddd","data-mapper","type-mongodb"],"author":{"name":"Jordan","email":"j@jrdn.org"},"license":"MIT","readme":"","readmeFilename":"","repository":{"type":"git","url":"git+https://github.com/j/type-mongodb.git"},"homepage":"https://github.com/j/type-mongodb#readme","bugs":{"url":"https://github.com/j/type-mongodb/issues"}}