{"_id":"mongo-dot-notation","_rev":"27-436fcb5f402abc1a7b300a8f48504782","name":"mongo-dot-notation","description":"Transform objects to MongoDB update instructions","dist-tags":{"latest":"3.1.1"},"versions":{"1.0.0":{"name":"mongo-dot-notation","version":"1.0.0","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.2.0","mocha":"^2.2.5"},"gitHead":"50c5045e54c2ece89e6fdda2cd2cbda052e4daab","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.0","_shasum":"7ad1e60189550f5b95afe55db258070dc9fdbabf","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"7ad1e60189550f5b95afe55db258070dc9fdbabf","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.0.tgz","integrity":"sha512-YX5WtpQPx3e05dd+st+xhdvdqnpuuJi7AP/OYBl7wIrpgsQI3Jv+6FDzao3I0T2OoxDmaHpp/9jglHm4YkuVRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIdvSVbQmqmi1Ivd4V/FzDSVBWsQah6DMa5To0h8xrLwIgT9bhKx/oIwdpnMCShPpoV5oaIWQWpg73sbUdw5rfR3U="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"directories":{}},"1.0.1":{"name":"mongo-dot-notation","version":"1.0.1","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.2.0","mocha":"^2.2.5","mongodb":"^2.0.42"},"gitHead":"c99c2068520f0550e19fed3c0362530a23ec39d1","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.1","_shasum":"9f773e229d99f7ac9f6cf1ea16c3e7eabc2b87cd","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"9f773e229d99f7ac9f6cf1ea16c3e7eabc2b87cd","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.1.tgz","integrity":"sha512-nINE2u41CkDcWmGuewZs6qUSiLSOUBtuljoWVgm/XpfHlBuSV+P4p19bi2vCx8WxdmEqg80UzFav+NIrbBgWBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDKK/ycF2HAmPqi3vdjvD9AUPM0h4TcgpUoK2i3SXXdaAiBOSkiwUjYxrM9uyVF1EbxP6mFnRjaHKvzkd1dx9v2fJA=="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"directories":{}},"1.0.4":{"name":"mongo-dot-notation","version":"1.0.4","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.4.1","mocha":"^2.3.4","mongodb":"^2.0.49"},"gitHead":"94b13f386b318aa1684e3c04ea0c022ba9fb513c","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.4","_shasum":"b7c8c485e73dd5261ba4f4e7ee242c74c4a03ea8","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"b7c8c485e73dd5261ba4f4e7ee242c74c4a03ea8","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.4.tgz","integrity":"sha512-tEdyWW0lD2Vc69b/S2UiFBFYjsr+L0nZ2TPeiVoZIep01CftdhFrpiPubzm2IGDQaaRXKLIKvYxsEFqI592ZOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5LSdSjLAYg09NBxvf0y0gpDPY+FrehK0i5SZkKs9TwAiB3x8ang6jzcZsdoi6ZvFJp0qYJEPl0H8gcC0zOGEx8lw=="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"directories":{}},"1.0.5":{"name":"mongo-dot-notation","version":"1.0.5","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5","mongodb":"^2.1.7"},"gitHead":"55e8934b2906fe6391c14c9c7f2ceb3d25a1bef5","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.5","_shasum":"f38404d0edaaf6560e1034ba14c6fb9fd150a620","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"f38404d0edaaf6560e1034ba14c6fb9fd150a620","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.5.tgz","integrity":"sha512-QptYjWVsKmIGeM42pwh4K5Lv8CunrXCHzCzygbSBQBKy4Z0zGQ5nz9YKhndVxu57RmZthiShGKfcpN5mzGM6Mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDX/eyq0p/r95o4j1p9kKAk72+Ir2/RR7r/DkMcB8y1LAiEAlddBhSe/nTBOI3YQCmic/uotoGpzJZnYQELww2xf4ug="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/mongo-dot-notation-1.0.5.tgz_1458314923419_0.8361630011349916"},"directories":{}},"1.0.6":{"name":"mongo-dot-notation","version":"1.0.6","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5","mongodb":"^2.1.7"},"gitHead":"8137ba893dfd387bb46b0a40dbc284f588ddca27","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.6","_shasum":"a950edd65770aac8ca6ea2e087f4a82ed03c3116","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"a950edd65770aac8ca6ea2e087f4a82ed03c3116","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.6.tgz","integrity":"sha512-y0O2gnon6cjQbJCd5ugh5fKkSRQdte3K5ms4x52U+tbRw/vIXsQWWlM1wOmEcBGpmjbm5vA1MgDOLxWSSSrojQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJooH2iWNDGy8PGfpOHM5JqsK0UdYUVuAQH4tuM0pEaAiA5UJdBcLTvQ9xQjYN1s3DJ5R5HpPrMpOhBYHr5NZAgUA=="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/mongo-dot-notation-1.0.6.tgz_1481581895107_0.1297431925777346"},"directories":{}},"1.0.7":{"name":"mongo-dot-notation","version":"1.0.7","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5","mongodb":"^2.1.7"},"gitHead":"58172326355e9d273597f19e05aad90a82e3f1dd","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.7","_shasum":"54d45c28ae7e5d84f68260a69cb9f8d6e898e4f3","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"54d45c28ae7e5d84f68260a69cb9f8d6e898e4f3","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.7.tgz","integrity":"sha512-gAs9+8W4vwDGTFK7RagOklHJOxcWkwIzogZJaSfre/ucY2Zi9XHKl1kfeQZElM94nzLEGWbeofboHXj/+9SRGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO/479oMUh8eFVVMC1OU4qryx8vh3VIG852/Y/cbJQBgIhAM1E3DSiLLnNJaYVrJAZi9+EIyn12NswP+5GEXDnaw89"}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/mongo-dot-notation-1.0.7.tgz_1484251279988_0.23995369928888977"},"directories":{}},"1.0.8":{"name":"mongo-dot-notation","version":"1.0.8","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5","mongodb":"^2.1.7"},"gitHead":"154eebd82bf7c20509e804e3ecd73b72bd45c0e9","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.0.8","_npmVersion":"5.0.0","_nodeVersion":"6.9.2","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"integrity":"sha512-cYKkA9A3tXwSC+AkEmJVQw9xoIrllw4swkMWqckClqes5VNRub8peJSDtc+ttSQkgGJwt6YIbrCu0C+SS/ejdw==","shasum":"cfe7ab1721b695d087560127868a528ddb679b1e","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.0.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjM7cjVy1HfdbOVEqSo6vhpB1RiQ9a8maBiqGMcEXROAIhAIjDD+KyYmvGml9+02/ZXSB2RSFFtnpivAy/J05vFhFT"}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation-1.0.8.tgz_1496243440016_0.6845735916867852"},"directories":{}},"1.1.0":{"name":"mongo-dot-notation","version":"1.1.0","description":"Convert simple objects to mongo update operators","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot-notation","conversion","operators","json","objects","parsing","data","flatten"],"license":"MIT","scripts":{"test":"mocha","test-ci":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly","lint":"eslint lib"},"devDependencies":{"chai":"^4.0.1","eslint":"^3.19.0","istanbul":"^0.4.5","mocha":"^3.4.2","mocha-lcov-reporter":"^1.3.0","mongodb":"^2.2.27"},"gitHead":"f53b6efeb7cdd9c9735ff21f7497d2a50cd62557","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.1.0","_shasum":"56933b0699d08eecd10008f9dc764442d3e60de6","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"56933b0699d08eecd10008f9dc764442d3e60de6","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.1.0.tgz","integrity":"sha512-yJ0K5m5am0XX2YvTNGxpGGZs6TlpgnlwJb5odDWFSSw2a+MbZtQJkQzxskaSNiZxi8/wYm4hC5Mwh5CV8+X5Ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCmtwl0YN8MDn7N3E78CnfC3IMaAj+5cQDQ5gv8SgiMAiEA8OxoL8GAtE77iSpdsFm1UbwOOx8bOF3fY6J5gnHhBW4="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation-1.1.0.tgz_1496875439760_0.8267031931318343"},"directories":{}},"1.2.0":{"name":"mongo-dot-notation","version":"1.2.0","description":"Transform objects to mongo update instructions","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"license":"MIT","scripts":{"test":"mocha","test-ci":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly","coverage":"istanbul cover node_modules/mocha/bin/_mocha --report html","lint":"eslint lib","perf":"node ./test/performance.js"},"devDependencies":{"chai":"^4.0.1","eslint":"^3.19.0","istanbul":"^0.4.5","mocha":"^3.4.2","mocha-lcov-reporter":"^1.3.0","mongodb":"^2.2.28"},"gitHead":"3ce9bbd932b3f6bf7ab1438e6a7bc4e09ae28aff","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@1.2.0","_shasum":"539f0b5824e9275ba0c27efc3b7e5aaca8310cdc","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"dist":{"shasum":"539f0b5824e9275ba0c27efc3b7e5aaca8310cdc","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-1.2.0.tgz","integrity":"sha512-kfT/SpDdILzIMB7ubjWXQxNK2iQ4PCfJs4f4788zKFj5/cww0EQkgLioitd1Ij+cDPgrZGtgS2eAs9CUk0thjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaNDaqVC7Vfl98QlXIAATmmmY7cX+XIrN/mKiDF74v2gIgCyN/iUz4oNMmjshjT1C8r30ZHDheC96A3VCAB5qh/gg="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation-1.2.0.tgz_1497140302957_0.12008676584810019"},"directories":{}},"2.0.0":{"name":"mongo-dot-notation","version":"2.0.0","description":"Transform objects to mongo update instructions","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"license":"MIT","scripts":{"test":"mocha","ci":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly","coverage":"istanbul cover node_modules/mocha/bin/_mocha --report html","lint":"eslint lib"},"devDependencies":{"chai":"^4.2.0","eslint":"^6.8.0","istanbul":"^0.4.5","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","mongodb":"^3.4.1"},"gitHead":"fdb33582d66ee2263fc082d5aad5a86e34217242","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@2.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ooU9nudAGxsMiTXYvfdL8DD9ouQoK2Na1lp4IT85J7uwJuS6770Y2plhkhrl/knMFjEQ0aJqXUMc3MAcnoCHKA==","shasum":"5971f44ba9693f33089750406d8de9bf7f73fa6f","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-2.0.0.tgz","fileCount":10,"unpackedSize":28691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeAj27CRA9TVsSAnZWagAAIiAP/RUXwi+fhmO5lR9HTdrk\nrd7d0A5/btZfQpD2Z5DgtpZLZlD5B1Vco/Y4/qEt04+V3SKNahEPtBC2neSh\nDCuosIlZijGF8lzrQWKinQdTlyASs5DHsbbb013HCVZPXbmtp/ftuNcU8kbu\nXCNYUobqW5z4qMji9VsK3/uBDXAIW5KlNIBJMyn5PKEMF/RRKnVrETiKIno/\nMQrEIDsM3Sq/dYmWaX7G7ALMfNwzILbqxiz2Kr89sgF/K77lJ4PIRyI6aca/\nwWeK355x3tRViL5luj4/9JX6Sd+W/a+QvVewK86376jutTyzvxGEgkvMO7n0\nPf/VP1VMTzzmlNde9SFuZagqPwqe8vJFFaCJotcWFdPmKl8M46QnXEHn5tNR\nePj1G9SHhCR4fdlax+v13dVbGRrpS6uFRRDuNQp+cIWxGcX08pY0HOAxL1TE\nQsEYPYGQR+9cN0cW0dnq/dzzT0WAvZOASbdz1ueoUG9jb7/9VxOTsEvwYFe8\nIjdkuPw7KyY+elosRx9wP6Z/u2SoIUiySGamMkyE7+dDVlyO2mEMT12qXwe+\n97ZusRcaLsJl+mJsJlvN7V2Ff86Ccw9in1jK/+/fJIzY3zJffoBa3tazt6qP\n6+Bkg4BGbxFYADeVW3n5Y/pZNKDM03vVMCjCwAZNUwIDTNZOgw44bhcL4s1F\n5/ZX\r\n=03ol\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQKWu5iVR32gJohLUhPeJkB15WpPAfNO65bLLlqHiJiAiAJWIoIZO3Ybb+aKryaXiJJDRMJu6byMp94rx3H0g5j5w=="}]},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation_2.0.0_1577205178979_0.587819619392165"},"_hasShrinkwrap":false},"3.0.0":{"name":"mongo-dot-notation","version":"3.0.0","description":"Transform objects to mongo update instructions","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./dist/index.js","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"license":"MIT","scripts":{"prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"eslint --ext .ts .","lint:fix":"eslint --ext .ts --fix .","build":"tsc -p .","test":"jest tests/*.spec.ts","test:coverage":"jest --coverage tests/*.spec.ts","test:e2e":"jest tests/*.e2e.ts","test:e2e:docker":"docker-compose up --no-log-prefix --exit-code-from node --attach node"},"devDependencies":{"@types/jest":"^28.1.6","@types/node":"^16.0.0","@typescript-eslint/eslint-plugin":"^5.30.7","@typescript-eslint/parser":"^5.30.7","eslint":"^8.20.0","jest":"^28.1.3","mongodb":"^4.8.0","prettier":"^2.7.1","ts-jest":"^28.0.7","ts-node":"^10.9.1","typescript":"^4.7.4"},"sideEffects":false,"gitHead":"de9eea65fa571de76bf418cf3fa1583f7920065e","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@3.0.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-hWlQNxyBWgPS82wTB5+wfzZeFwk8T00naRih7YqJP2EawZVALCmiYkjThRsYm6CpAag0AdTuFkrtwBJ3TpXyLQ==","shasum":"6c3f29dbc83b543bb439fd0cd82fba1263c9c638","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-3.0.0.tgz","fileCount":15,"unpackedSize":73440,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgUBAHUgV0oLwepmuOB81Z0S66Sug5YJybI7FGc3gLiAIhAI1s1NTdh5Ukbs4w+3Q7bv1WyBV9O3hfR+Ezd2wOaC9J"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi34wIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrrog//QNndihrF52zHmU5NNgYJSF4x0r1H8j1WmQiIt07VJCJC8VGx\r\nZ8LY0APyBG2HQK57UTbXNzL1LYlQZuy2uSIeUDhtsYZxtoEN/0wuPWbfWjzo\r\ndb18hVhGUlZKMhsiaoZS0vSveIBTlDILMqvp9QJD+hxniq35FSiFTKaKh1Kh\r\nr8bC5ShhCIkVtOd8QK6/riv6OyCl26/r3qpJb6RSOnnAZIcqsHBr62RV9IIm\r\n6zDAcYcDBgiyKRyeE7Zxtmw4f8JZ/eiMLBvAfz02ezZ8ho+Y2U7N16uoPu1y\r\nwjJgjTaSMfgK45DtO83Fc+umFciAXXATjGXg76fAuTaePuzQVU3YeyvWOxaa\r\nF/gDO1ZK7lB3y7OZX3k2JNl3hz7QTQVs6t1GsFBoKekn2VHxxokTWG6nyaxj\r\n0Qtg8rMKTQy0F7y0qBec3Z8ECCAkl0n6soUeW1kbR4BN0au2YvI8agP1Hrmf\r\n1KsGIWU/uvCnJKS97sMRl5w/BeSAEnapEOkBlNLDkS72/ubIgmx5w3F57yvR\r\nTYjttdabMlPENDp+g2t/ewjaDjCe5qf/SbZ3Vlo9wZNoLpYVWLbEZBXPjWwp\r\nmlIYcW2/n439QpE/ceio822kRM90Qux5HlYKBGfyrAihTxGwka1d2LratWWf\r\nhsdBj1/HvyucufuKxEszsaA2PhTU0bapCM4=\r\n=8D6r\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"directories":{},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation_3.0.0_1658817543976_0.7758494474632598"},"_hasShrinkwrap":false},"3.0.1":{"name":"mongo-dot-notation","version":"3.0.1","description":"Transform objects to mongo update instructions","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./dist/index.js","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"license":"MIT","scripts":{"prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"eslint --ext .ts .","lint:fix":"eslint --ext .ts --fix .","build":"tsc -p .","test":"jest tests/*.spec.ts","test:coverage":"jest --coverage tests/*.spec.ts","test:e2e":"jest tests/*.e2e.ts","test:e2e:docker":"docker-compose up --no-log-prefix --exit-code-from node --attach node"},"devDependencies":{"@types/jest":"^28.1.6","@types/node":"^16.0.0","@typescript-eslint/eslint-plugin":"^5.30.7","@typescript-eslint/parser":"^5.30.7","eslint":"^8.20.0","jest":"^28.1.3","mongodb":"^4.8.0","prettier":"^2.7.1","ts-jest":"^28.0.7","ts-node":"^10.9.1","typescript":"^4.7.4"},"sideEffects":false,"gitHead":"0c983bf221672e61db3cc2bfaf40e52247ca3320","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@3.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-0wgwHHHG3lX8FGb4LE5VYhBNcIC5t9AXZ9IIistJnkEr7tUjbxMYzGA9o//dOjHlj89iof0hE1hv48szatPYcw==","shasum":"6c1eccf3eb5c947ab84ca2cbfb7c2fc7c305e44a","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-3.0.1.tgz","fileCount":15,"unpackedSize":73440,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKky4gEmgbCOkC/r+24+fd02Cd7qnd53M4Xn1Eb/oyNgIhAPPAoreXscNqZW8CxA1P4SlqsP8wrKFrXkXjJYrxTylz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi34/HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJ+w//corRxAnHfy1eZC8CiC+90HpT254ZbeXz95FO10T77uogE6b0\r\neGLgIFUxAuFR34cEl+FD86BQ8VDv7xz6xlIE3VQE1CHjoTUp5mT2auuAd+NW\r\nSyKA2n7V0sYMW2J6y+Pvxeva08261zGlHdrOFUmlwTfUAZYInN02wudidyvG\r\nUagtBYw2GUOy8ML22DSlYaD6vGBPjLOxtz3AVF1BiRdq65zOvLzyJhkF5qfq\r\netd32vX5y2w2jg0JU2dRsCgoN+NmrX9HJG6hcupT3SJ/Jv6sbLZn3MJpJQmZ\r\nRJjKqCtKw7GZCQxkxiG9DlhWiWgq4Zy3doj5fWl7W9URLS/bS5SCh8T23I58\r\nOr5g9QuuSnTEK4qVz86yxRDGT/pP5v0045xCPt3UUIRVHtshbt8plAkDeRmV\r\nvlk58dpF//XvdISxmtMems1S/rxZee0pFqQ/JO4jxa3Tu9KiYiK6nQOOTmkk\r\nHrZ97ssRmlGNHZGPf2rRIPFYHoXNfqVqp/ChHWQZM1+7fHuPHGkK29KWot6v\r\nPB8ycjZpQn7vd2cvctG1U3UHQC5eJQ5YVGihrtZKXrE7QuIoNYXdA4y/QFpr\r\nHwzRhTad1xXmejv/U8yJDDBDs+E9KrmPFM2sT37kGmKVz2lwchm5ijXq4MCv\r\nIj9j/CJ6J90Oe3SJccJyk8Nxh+InJpZ9LjU=\r\n=Nr02\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"directories":{},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation_3.0.1_1658818503648_0.3944323217179144"},"_hasShrinkwrap":false},"3.1.0":{"name":"mongo-dot-notation","version":"3.1.0","description":"Transform objects to MongoDB update instructions","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./dist/index.js","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"license":"MIT","scripts":{"prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"eslint --ext .ts .","lint:fix":"eslint --ext .ts --fix .","build":"tsc -p .","test":"jest tests/*.spec.ts","test:coverage":"jest --coverage tests/*.spec.ts","test:e2e":"jest tests/*.e2e.ts","test:e2e:docker":"docker-compose up --no-log-prefix --exit-code-from node --attach node"},"devDependencies":{"@types/jest":"^28.1.6","@types/node":"^16.0.0","@typescript-eslint/eslint-plugin":"^5.30.7","@typescript-eslint/parser":"^5.30.7","eslint":"^8.20.0","jest":"^28.1.3","mongodb":"^4.8.0","prettier":"^2.7.1","ts-jest":"^28.0.7","ts-node":"^10.9.1","typescript":"^4.7.4"},"sideEffects":false,"gitHead":"dc81d125e7ecb193395ce8e28c3ff289d708cda1","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_id":"mongo-dot-notation@3.1.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-wxbnPPpWL2cV0cZskYgLyxltOZTlQugGf06eHfTzPiGnVYyxNModbYOCCMquJqOz0T0XYvGnH3qw+XFznDXYgg==","shasum":"2911ca2770a5449c1457ec33ac1e03af85552866","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-3.1.0.tgz","fileCount":15,"unpackedSize":76877,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF2ksHy80uqVHQR/UkrXMY0yEERoVy1Qw12Zc5cEgOhgIgUZ1i0GjPCTtR5EIbe729nxdrOPw4tDh30+2QQY5ucHY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4ivwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhlA//b3UWnMWxF+/BEcdaWIR/ETejE6KtBkPHrdLzSAONgoDtvNWv\r\nSB5XF/o9ZjPPdQxPKS090WMzzbXrSl4ZVwWQr2IdHDEg18D2adUxUQ0eV/2U\r\nh+ynOmQBBAldQViAppBpCj9F4LfPu9KK8JxL7dibw0mymIhONsDQ6UOsZpVt\r\nq/Qaqyx9hnFisVCNYsyk4ThWDBwAZBlXEE0tLTBhrp1lAF3LADm1NQmBGtxk\r\nuqPx33piJupTEjpCG+0rI+S+zRFWg5wj2p5B1vQgL1hiMkfb6cXv7U/Ad566\r\nCKHFW4Zt/SaHd+FFcI/r5iM6NV4izxfL/GaDcBaqNpQgsiydFlpBg1o2TAis\r\nSBX26GoaBgp/vJQfJfs5VQLTScWmqNGncHhJ7s+BpdvKsza3JvX848MOrNTF\r\nF2VW6gQaZpMtD+NJZjPUrur/CXyBAcBlpHPVCFOC2xHtlPQyf2FYPVXGe9g5\r\nGSLCiud8lgB3TIFUGewFwwuVC6rPjDqK/6sjXnOX8YXXpX9i+Bmh64KiwM7d\r\nF27LnYBN6HXXeOcXpyks3t/mDHzoXX2lLyqGhKnsnr1gUWBrPiKkc+xoVtpK\r\nzx6sWZRkPj8r9/UImlWb+ZyiXu8b0IoMX2GnycXsyQ0MRUIFC7qddxH2bBSF\r\nn74OPQ+1DP0Jy9kRqW/WuqNOOX4W/Fn1U2s=\r\n=bFQT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"directories":{},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation_3.1.0_1658989552060_0.5183757506330551"},"_hasShrinkwrap":false},"3.1.1":{"name":"mongo-dot-notation","version":"3.1.1","description":"Transform objects to MongoDB update instructions","author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"main":"./dist/index.js","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"license":"MIT","scripts":{"prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"eslint --ext .ts .","lint:fix":"eslint --ext .ts --fix .","build":"tsc -p .","test":"jest tests/*.spec.ts","test:coverage":"jest --coverage tests/*.spec.ts","test:e2e":"jest tests/*.e2e.ts","test:e2e:docker":"docker compose up --no-log-prefix --exit-code-from node --attach node"},"devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.30","@typescript-eslint/eslint-plugin":"^7.4.0","@typescript-eslint/parser":"^7.4.0","eslint":"^8.57.0","jest":"^29.7.0","mongodb":"^6.5.0","prettier":"^3.2.5","ts-jest":"^29.1.2","ts-node":"^10.9.2","typescript":"^5.4.3"},"sideEffects":false,"_id":"mongo-dot-notation@3.1.1","gitHead":"e4124cee6cc54c33f336397e9898e37de039be4e","homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-NKBDLx92H+aRO1bu0QgxGe0ARo76gTQsgry2caemSVwkxWUH0myyZkvR1LUFuBJfLiN1kb+Axwn6MNM5ahXjOg==","shasum":"062bc1844866f142d613c8d70251d3213ddb55a4","tarball":"https://registry.npmjs.org/mongo-dot-notation/-/mongo-dot-notation-3.1.1.tgz","fileCount":15,"unpackedSize":76798,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCl+opBJR7Sp7cWPvxerKAfLjREyQ8/0Vk2Ae8ustRxDwIhALRWYOUQkQl92lrE7uHiL+fl2xJJ0QLvbgcMzmOJ8MVl"}]},"_npmUser":{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"},"directories":{},"maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongo-dot-notation_3.1.1_1711751043648_0.9086649827770075"},"_hasShrinkwrap":false}},"readme":"# mongo-dot-notation\n\nTransform objects to MongoDB update instructions.\n\n[![Build status](https://github.com/dimadeveatii/mongo-dot-notation/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/dimadeveatii/mongo-dot-notation/actions/workflows/ci.yml?query=branch%3Amain++)\n[![Coverage Status](https://coveralls.io/repos/github/dimadeveatii/mongo-dot-notation/badge.svg?branch=main)](https://coveralls.io/github/dimadeveatii/mongo-dot-notation?branch=main)\n[![NPM Version](https://img.shields.io/npm/v/mongo-dot-notation.svg)](https://npmjs.org/package/mongo-dot-notation)\n[![Downloads](https://img.shields.io/npm/dm/mongo-dot-notation)](https://npmjs.org/package/mongo-dot-notation)\n\n```ts\nimport { flatten, $timestamp, $unset } from 'mongo-dot-notation';\n\nconst user = flatten({\n  firstName: 'Alice',\n  contact: { phone: '874-478-1254' },\n  address: {\n    primary: {\n      state: 'NY',\n      nr: 42,\n    },\n  },\n});\n```\n\nSets `user` to:\n\n```json\n{\n  \"$set\": {\n    \"firstName\": \"Alice\",\n    \"contact.phone\": \"874-478-1254\",\n    \"address.primary.state\": \"NY\",\n    \"address.primary.nr\": 42\n  }\n}\n```\n\n## Installation\n\n```sh\nnpm install mongo-dot-notation\n```\n\n## Highlights\n\n- Supports all MongoDB [update operators](https://www.mongodb.com/docs/manual/reference/operator/update/)\n  - Field update operators\n  - Array update operators\n  - Bitwise update operators\n- No `npm` dependency on `mongo`\n- Written in TypeScript\n  - Type definitions for all exported functions\n- Supports flattening and updating array elements by index\n\n## Usage and examples\n\n### Using operators to update fields\n\n```ts\nimport { flatten, $inc, $currentDate, $push, $setOnInsert } from 'mongo-dot-notation';\n\nconst review = {\n  // Add a comment and keep only the last ten ones\n  comments: $push('Like it!').$each().$slice(-10),\n  rating: 10,\n  counters: {\n    // increment the `total` by one\n    total: $inc(),\n  },\n  details: {\n    // set only if the document is inserted\n    createdOn: $setOnInsert(new Date()),\n    // set to current date as a mongo Date\n    updatedOn: $currentDate(),\n  },\n};\n\n// Provided reviews is a MongoDB collection\nawait reviews.updateOne(reviewId, flatten(review), { upsert: true });\n```\n\n### Flattening arrays\n\n```ts\nimport { flatten } from 'mongo-dot-notation';\n\nconst user = {\n  phones: [\n    {\n      number: '123-456-789',\n      primary: true,\n    },\n    {\n      number: '789-012-345',\n    },\n  ],\n};\n\n// Provided users is a MongoDB collection\nawait users.updateOne(userId, flatten(user, { array: true }));\n```\n\nThe above `user` object is flattened to:\n\n```json\n{\n  \"phones.0.number\": \"123-456-789\",\n  \"phones.0.primary\": true,\n  \"phones.1.number\": \"789-012-345\"\n}\n```\n\n### Using positional operator\n\n```ts\nimport { flatten, $, $inc } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $().$inc(),\n};\n\n// Finds the element with value 80 in the \"grades\" array\n// and increments it by one.\nstudent.updateOne(\n  { _id: 1, grades: 80 },\n  flatten(student) // { $inc: { \"grades.$\" : 1 } }\n);\n```\n\nThe position operator supports updating a nested document:\n\n```ts\nimport { flatten, $, $inc } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $('value').$inc(),\n};\n\n// Finds the document with \"value\" field equal to 80 in the \"grades\" array\n// and increments it by one.\nstudent.updateOne(\n  { _id: 1, grades: 80 },\n  flatten(student) // { $inc: { \"grades.$.value\" : 1 } }\n);\n```\n\nTo update all elements in a array, use _all positional_ operator:\n\n```ts\nimport { flatten, $, $inc } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $('[]').$inc(),\n};\n\n// Increment all grades by one\nstudent.updateOne(\n  { _id: 1 },\n  flatten(student) // { $inc: { \"grades.$[]\" : 1 } }\n);\n```\n\nSimilarly, updating nested documents:\n\n```ts\nimport { flatten, $, $inc } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $('[].values').$inc(),\n};\n\n// Increment all grades' values by one\nstudent.updateOne(\n  { _id: 1 },\n  flatten(student) // { $inc: { \"grades.$[].values\" : 1 } }\n);\n```\n\n### Using filtered positional operator\n\n```ts\nimport { flatten, $, $mul } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $('[element]').$mul(9),\n};\n\n// Multiply by ten all grades that are below 9\nstudent.updateOne(\n  { _id: 1 },\n  flatten(student), // { $mul: { \"grades.$[element]\" : 10 } }\n  { arrayFilters: [{ element: { $lte: 9 } }] }\n);\n```\n\nSimilarly, updating nested documents:\n\n```ts\nimport { flatten, $, $mul } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $('[element].value').$mul(9),\n};\n\n// Multiply by ten all grades that are below 9\nstudent.updateOne(\n  { _id: 1 },\n  flatten(student), // { $mul: { \"grades.$[element].value\" : 10 } }\n  { arrayFilters: [{ 'element.value': { $lte: 9 } }] }\n);\n```\n\n### Merge array documents\n\nUsing positional operator to merge fields into the matched element:\n\n```ts\nimport { flatten, $, $inc, $currentDate } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $().merge({\n    class: '101',\n    prof: 'Alice',\n    value: $inc(),\n    date: $currentDate(),\n  }),\n};\n\nflatten(student);\n```\n\nResult:\n\n```json\n{\n  \"$set\": {\n    \"grades.$.class\": \"101\",\n    \"grades.$.prof\": \"Alice\"\n  },\n  \"$inc\": {\n    \"grades.$.value\": 1\n  },\n  \"$currentDate\": {\n    \"grades.$.date\": { \"$type\": \"date\" }\n  }\n}\n```\n\nTo update all elements, use `$('[]')` instead of `$()` in the above example.\n\n### Update nested arrays\n\nUsing positional operator to update nested arrays:\n\n```ts\nimport { flatten, $, $mul } from 'mongo-dot-notation';\n\nconst student = {\n  grades: $().merge({\n    questions: $('[]').merge({\n      value: $mul(100),\n    }),\n  }),\n};\n\nflatten(student);\n```\n\nCalling `flatten(student)` results in:\n\n```json\n{\n  \"$mul\": {\n    \"grades.$.questions.$[].value\": 100\n  }\n}\n```\n\nSee the [end-to-end](tests/mongo.e2e.ts) tests file for more examples.\n\n## API\n\n**Table of contents**\n\n- [Options](#options)\n- [flatten](#flatten)\n- [isOperator](#isOperator)\n\n- [Field update operators](#field-update-operators)\n\n  - [$currentDate](#currentdate)\n  - [$timestamp](#timestamp)\n  - [$inc](#inc)\n  - [$min](#min)\n  - [$max](#max)\n  - [$mul](#mul)\n  - [$rename](#rename)\n  - [$set](#set)\n  - [$setOnInsert](#setoninsert)\n  - [$unset](#unset)\n\n- [Array update operators](#array-update-operators)\n\n  - [$](#-positional)\n  - [$addToSet](#addtoset)\n  - [$pop](#pop)\n  - [$pull](#pull)\n  - [$push](#push)\n  - [$pullAll](#pullall)\n  - [$slice](#slice)\n  - [$sort](#sort)\n\n- [Bitwise update operators](#bitwise-update-operators)\n\n  - [$bit](#bit)\n  - [$and](#and)\n  - [$or](#or)\n  - [$xor](#xor)\n\n### Options\n\nThe following options are available:\n\n| Option             | Description                                                                                   |\n| ------------------ | --------------------------------------------------------------------------------------------- |\n| `array`            | _(default `false`)_ if true, arrays will be flattened and their indexes will be used as keys. |\n| `skipEmptyObjects` | _(default `false`)_ if true, empty objects are ignored and removed from the flattened result. |\n\n**Example:**\n\n```ts\nflatten({ rules: [{ value: 7 }] }, { array: true });\n// { $set: { 'rules.0.value': 7 } }\n\nflatten({ rules: [{ value: 7 }] }, { array: false });\n// { $set: { 'rules': [{value: 7}] } }\n\nflatten({ left: { x: 1 }, right: {} }, { skipEmptyObjects: true });\n// { $set: { 'left.x': 1 } }\n\nflatten({ left: { x: 1 }, right: {} }, { skipEmptyObjects: false });\n// { $set: { 'left.x': 1, 'right': {} } }\n```\n\n### flatten\n\n> `$flatten<T>(obj: T, options?: Options)`\n\nTransforms a given object into the MongoDB's update instructions.\n\n| Param     | Description                                              |\n| --------- | -------------------------------------------------------- |\n| `obj`     | _(required)_ the input object to transform               |\n| `options` | _(optional)_ additional options, see [Options](#options) |\n\n**Example:**\n\n```ts\nflatten({\n  firstName: 'Alice',\n  contact: { phone: '874-478-1254' },\n  address: {\n    primary: {\n      state: 'NY',\n      nr: 42,\n    },\n  },\n});\n```\n\n### isOperator\n\n> `isOperator<T>(obj: T): boolean`\n\nChecks if a given object is an operator.\n\n| Param | Description                            |\n| ----- | -------------------------------------- |\n| `obj` | _(required)_ the input object to check |\n\n**Example:**\n\n```ts\nisOperator($set(1)); // true\nisOperator({}); // false\n```\n\n---\n\n### Field update operators\n\n### $currentDate\n\n> `$currentDate(type?: 'date' | 'timestamp')`\n\n| Param  | Description                                                                                                                                                                                                                                                     |\n| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `type` | _(default `date`)_ sets to MongoDB's [Date](https://www.mongodb.com/docs/manual/reference/bson-types/#std-label-document-bson-type-date) or [Timestamp](https://www.mongodb.com/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp) type. |\n\nSets the value of a field to the current date.\n\n**Example:**\n\n```ts\nflatten({\n  createdOn: $currentDate(),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/currentDate/)\n\n### $timestamp\n\n> `$timestamp()`\n\nSets the value of a field to the current date as a MondoDB's [Timestamp](https://www.mongodb.com/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp) type.\n\nThis function is an alias for `$currentDate('timestamp')`.\n\n**Example:**\n\n```ts\nflatten({\n  updatedOn: $timestamp(),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/currentDate/)\n\n### $inc\n\n> `$inc<T>(value?: T)`\n\nIncrements a field by a specified value.\n\n| Param   | Description                   |\n| ------- | ----------------------------- |\n| `value` | _(default 1)_ increment value |\n\n**Example:**\n\n```ts\nflatten({\n  visits: $inc(),\n  clicks: $inc(5),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/inc/)\n\n### $min\n\n> `$min<T>(value: T)`\n\nUpdates the value of the field to a specified value if the specified value is **less than** the current value of the field.\n\n| Param   | Description            |\n| ------- | ---------------------- |\n| `value` | _(required)_ min value |\n\n**Example:**\n\n```ts\nflatten({\n  score: $min(100),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/min/)\n\n### $max\n\n> `$max<T>(value: T)`\n\nUpdates the value of the field to a specified value if the specified value is **greater than** the current value of the field.\n\n| Param   | Description            |\n| ------- | ---------------------- |\n| `value` | _(required)_ max value |\n\n**Example:**\n\n```ts\nflatten({\n  score: $max(0),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/max/)\n\n### $mul\n\n> `$mul<T>(value?: T)`\n\nMultiplies the value of a field by a number.\n\n| Param   | Description                   |\n| ------- | ----------------------------- |\n| `value` | _(default 1)_ multiply factor |\n\n**Example:**\n\n```ts\nflatten({\n  score: $mul(2.5),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/max/)\n\n### $rename\n\n> `$rename(field: string)`\n\nUpdates the name of a field.\n\n| Param   | Description                 |\n| ------- | --------------------------- |\n| `field` | _(required)_ new field name |\n\n**Example:**\n\n```ts\nflatten({\n  profile: {\n    first_name: $rename('firstName'),\n  },\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/rename/)\n\n### $set\n\n> `$set<T>(value: T)`\n\nReplaces the value of a field with the specified value.  \nThis is an implicit operator, but could be useful when an entire object should be replaced.\n\n| Param   | Description                    |\n| ------- | ------------------------------ |\n| `value` | _(required)_ replacement value |\n\n**Example:**\n\n```ts\n// Replaces the address object entirely rather than just\n// updating the \"city\" field.\nflatten({\n  address: $set({ city: 'NY' }),\n  profile: { name: 'Alice' },\n});\n\n// Outputs:\n// {\n//   \"$set\": {\n//     \"address\": { \"city\": \"NY\" },\n//     \"profile.name\": \"Alice\"\n//   }\n// }\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/set/)\n\n### $setOnInsert\n\n> `$setOnInsert<T>(value: T)`\n\nAssigns the specified value to the field when `{ upsert: true }` operation is used and\nresults in a new document being created. If the update operation does not result in an insert,\ndoes nothing.\n\n| Param   | Description                                        |\n| ------- | -------------------------------------------------- |\n| `value` | _(required)_ the value to set on document creation |\n\n**Example:**\n\n```ts\nflatten({\n  logging: {\n    createdOn: $setOnInsert(new Date()),\n  },\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/setOnInsert/)\n\n### $unset\n\n> `$unset()`\n\nDeletes the specified field from a document.\n\n**Example:**\n\n```ts\nflatten({\n  resetPassword: $unset(),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/unset/)\n\n---\n\n### Array update operators\n\n### $ _(positional)_\n\n> `$(field?: number | string)`\n\nThe positional operator identifies **an element** or **multiple elements** matching a\ngiven query condition to be updated in an array.\n\n| Param   | Description                                                                                                                                                                                                                                                                          |\n| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `field` | _(optional)_ when empty - performs the update on array's element; <br/>when a number or a string starting with a number, specifies the index of the element to update or its field;<br/>when starts with `\"[]\"` or `\"[query]\"`, specifies that this is an _all positional_ operator; |\n\n**Example:**\n\n```ts\n// Sets to 7 first element that matches the update query\n$().$set(7);\n\n// Increment by one the first element's `score` field that matches the update query\n$('score').$inc(1);\n\n// Multiplies all elements by two\n$('[]').$mul(2);\n\n// Ensures all elements in array are positive\n$('[].score').$max(0);\n\n// Find all `grades` documents that have the `std` lower than seven\n// and increment their `grade` by ten.\ncollection.updateOne(criteria, flatten({ grades: $('[element].grade').$inc(10) }), {\n  arrayFilters: [{ 'element.std': { $lt: 7 } }],\n});\n```\n\nSee [update nested arrays](#update-nested-arrays) for examples using `$().merge`.\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/positional/)\n\n### $addToSet\n\n> `$addToSet<T>(value: T | T[])`\n\nAdds a value to an array unless the value is already present.\nTo add multiple values, chain with `$each` operator.\n\n| Param   | Description                              |\n| ------- | ---------------------------------------- |\n| `value` | _(required)_ the value to add to the set |\n\nNote that while `$addToSet([1, 2])` adds the entire array as single element,\n`$addToSet([1, 2]).$each()` adds 1 and 2 as separate elements.\n\n**Example:**\n\n```ts\n// add just one element\nflatten({ permissions: $addToSet('admin') });\n\n// add multiple elements\nflatten({ permissions: $addToSet(['read', 'write']).$each() });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/addToSet/)\n\n### $pop\n\n> `$pop(value?: -1 | 1)`\n\nRemoves the first or last element of an array\n\n| Param   | Description                                                                            |\n| ------- | -------------------------------------------------------------------------------------- |\n| `value` | _(default 1)_ specify `-1` to remove the first element, `1` to remove the last element |\n\n**Example:**\n\n```ts\n// remove the first element from the array\nflatten({ grades: $pop(-1) });\n// equivalent to:\nflatten({ grades: $pop().first() });\n\n// remove the last element from the array\nflatten({ scores: $pop(1) });\n// equivalent to:\nflatten({ scores: $pop().last() });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/pop/)\n\n### $pull\n\n> `$pull<T>(value: T | T[])`\n\nRemoves from an existing array all instances of a value or values that match a specified condition.\nUnlike the [$pullAll](#pullall) operator, this operator can be used to remove all instances that match a query.\n\n| Param   | Description                                                                        |\n| ------- | ---------------------------------------------------------------------------------- |\n| `value` | _(required)_ the value(s) to remove or the condition to match for removed elements |\n\n**Example:**\n\n```ts\n// remove all instances of the value `0` and `1` from the array;\n// same as using $pullAll\nflatten({ scores: $pull([0, 1]) });\n\n// remove all instances lower than or equal to `3`\nflatten({ scores: $pull({ $lte: 3 }) });\n\n// remove all documents with the field `name` equal to `Test`\nflatten({ users: $pull({ name: { $eq: 'Test' } }) });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/pull/)\n\n### $push\n\n> `$push<T>(value?: T | T[])`\n\nAppends a specified value to an array.\nCan be chained with `.$slice()`, `.$sort()` and `.$position()` modifiers to specify how the array should be updated.  \nThe order in which additional operators are chained doesn't matter, so that `$push().$each().$slice().$sort()` is the same as\n`$push().$each().$sort().$slice()`.\n\n| Param   | Description                                      |\n| ------- | ------------------------------------------------ |\n| `value` | _(optional)_ the value(s) to append to the array |\n\n**Example:**\n\n```ts\n// append one element\nflatten({ scores: $push(1) });\n\n// append multiple elements\nflatten({ scores: $push([1, 2, 3]).$each() });\n\n// append an element and update to leave only the last ten\nflatten({ scores: $push(7).$each().$slice(-10) });\n\n// append an element and update to leave only the last ten sorted by value\nflatten({ scores: $push(7).$each().$sort(1).$slice(-10) });\n\n// append an element at position three in the array\nflatten({ scores: $push(7).$each().$position(2) });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/push/)\n\n### $pullAll\n\n> `$pullAll<T>(value: T | T[])`\n\nRemoves all instances of the specified values from an existing array.\n\n| Param   | Description                                        |\n| ------- | -------------------------------------------------- |\n| `value` | _(required)_ the value(s) to remove from the array |\n\n**Example:**\n\n```ts\n// remove all instances of the value `1` and `2` from the array\nflatten({ score: $pullAll([1, 2]) });\n\n// remove all instances of the value `0`\nflatten({ score: $pullAll(0) });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/pullAll/)\n\n### $slice\n\n> `$slice(count: number)`\n\nLimits the number of array elements.\nAlias for `$push().$each().$slice()`.\n\n| Param   | Description                             |\n| ------- | --------------------------------------- |\n| `count` | _(required)_ number of elements to take |\n\n**Example:**\n\n```ts\n// leave only the first 3 elements\nflatten({ grades: $slice(3) });\n\n// leave only the last element\nflatten({ grades: $slice(-1) });\n\n// empty the array\nflatten({ grades: $slice(0) });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/slice/)\n\n### $sort\n\n> `$sort<T>(specification?: T)`\n\nOrders the elements of an array.\nAlias for `$push().$each().$sort()`.\n\n| Param           | Description                      |\n| --------------- | -------------------------------- |\n| `specification` | _(default 1)_ sort specification |\n\n**Example:**\n\n```ts\n// sort ascending\nflatten({ scores: $sort(1) });\n\n// sort descending\nflatten({ scores: $sort(-1) });\n\n// sort ascending an array of documents with `name` field\nflatten({ users: $sort({ name: 1 }) });\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/sort/)\n\n---\n\n### Bitwise update operators\n\n### $bit\n\n> `$bit()`\n\nPerforms a bitwise update of a field.\nShould be chained with a logical operator.\n\n**Example:**\n\n```ts\nflatten({\n  admin: $bit().$and(7),\n  read: $bit().$or(4),\n  write: $bit().$xor(3),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/bit/)\n\n### $and\n\n> `$and<T>(value: T)`\n\nUses a bitwise _and_ operation to update a field.\nAlias for `$bit().$and()`.\n\n**Example:**\n\n```ts\nflatten({\n  admin: $and(7),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/bit/#bitwise-and)\n\n### $or\n\n> `$or<T>(value: T)`\n\nUses a bitwise _or_ operation to update a field.\nAlias for `$bit().$or()`.\n\n**Example:**\n\n```ts\nflatten({\n  read: $or(4),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/bit/#bitwise-or)\n\n### $xor\n\n> `$xor<T>(value: T)`\n\nUses a bitwise _xor_ operation to update a field.\nAlias for `$bit().$xor()`.\n\n**Example:**\n\n```ts\nflatten({\n  write: $xor(3),\n});\n```\n\n[MongoDB manual](https://www.mongodb.com/docs/manual/reference/operator/update/bit/#bitwise-xor)\n\n## License\n\n[MIT](LICENSE)\n","maintainers":[{"name":"dimadeveatii","email":"dimadeveatii@gmail.com"}],"time":{"modified":"2024-03-29T22:24:03.983Z","created":"2015-08-19T16:48:59.533Z","1.0.0":"2015-08-19T16:48:59.533Z","1.0.1":"2015-08-19T20:42:47.664Z","1.0.4":"2015-11-26T06:37:22.108Z","1.0.5":"2016-03-18T15:28:45.904Z","1.0.6":"2016-12-12T22:31:35.705Z","1.0.7":"2017-01-12T20:01:22.002Z","1.0.8":"2017-05-31T15:10:40.865Z","1.1.0":"2017-06-07T22:44:00.781Z","1.2.0":"2017-06-11T00:18:24.049Z","2.0.0":"2019-12-24T16:32:59.110Z","3.0.0":"2022-07-26T06:39:04.184Z","3.0.1":"2022-07-26T06:55:03.851Z","3.1.0":"2022-07-28T06:25:52.217Z","3.1.1":"2024-03-29T22:24:03.800Z"},"homepage":"https://github.com/dimadeveatii/mongo-dot-notation#readme","keywords":["mongo","dot","dot-notation","transform","convert","operators","instructions","json","objects","parsing","data","flatten","update"],"repository":{"type":"git","url":"git+https://github.com/dimadeveatii/mongo-dot-notation.git"},"author":{"name":"Dumitru Deveatii","email":"dimadeveatii@gmail.com"},"bugs":{"url":"https://github.com/dimadeveatii/mongo-dot-notation/issues"},"license":"MIT","readmeFilename":"README.md","users":{"antony":true,"electblake":true,"krishaamer":true}}