{"_id":"@aliatech/loopback-mongo-aggregate-mixin","_rev":"6-af3b62fb7d2d1385124b0d02173cf587","name":"@aliatech/loopback-mongo-aggregate-mixin","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@aliatech/loopback-mongo-aggregate-mixin","version":"1.0.0","description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","publishConfig":{"access":"public"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"scripts":{"lint":"eslint index.js","test":"mocha","test-with-coverage":"nyc --reporter=text --reporter=text-summary --reporter=html mocha","publish-coverage":"nyc report --reporter=text-lcov | coveralls"},"main":"index.js","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"dependencies":{"lodash":"^4.17.11"},"devDependencies":{"coveralls":"^3.0.2","eslint":"^5.13.0","eslint-config-google":"^0.12.0","loopback":"^3.25.0","loopback-boot":"^2.27.1","loopback-connector-mongodb":"^3.9.2","mocha":"^5.2.0","nyc":"^13.2.0","should":"^13.2.3"},"gitHead":"4a5188dc676a4fbd4de32bdae98827be73a2eedc","bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","_id":"@aliatech/loopback-mongo-aggregate-mixin@1.0.0","_nodeVersion":"9.11.2","_npmVersion":"6.8.0","dist":{"integrity":"sha512-+W4hDh5GPh1ns7iO6C855DLsXBXLBvCAN0zIFXaqLBoSKdplSx1Go8VdwA6qQWwnkdn1rdJZUH9yEE1kVsX9Bg==","shasum":"3d411ff83b6d9a859943455b7ed3a5bb15c9160c","tarball":"https://registry.npmjs.org/@aliatech/loopback-mongo-aggregate-mixin/-/loopback-mongo-aggregate-mixin-1.0.0.tgz","fileCount":29,"unpackedSize":53479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbtZTCRA9TVsSAnZWagAAcZkP/0DpQtMXKoufREy87EsQ\njso2t1Lu6mx182x/2fdfsV2G23BG65g90ZcsnVAWOuaXkrEoqwPMj1Fsbagr\npin1WsEjFMt3PnMYZv4KtjHgGTG4+PNWpdoxY9wwmz4un4nb1AoDnYm/Eul7\nVGfSumkNtO2pWOw9lHF3zy5ub+azJ8yUD2QfBlQi/vFYAblkf1wN9oQZqXGH\nC/1HfE3yQcPRt6wxQzcZaEyC4OLGihS2ZzxcENcdgL3aonNQNMzSoMz05nls\nM2Co2KwftZjDGn+LdmOAAP0lWwhQArLwaej+/WQ/nMcUqPgBJer3gey7dtO6\nRJEgHmc6DdWoGWLiYF8bal5GpJ+IokfnmS5T7dx0XzEfJ5nnzKrPbrABaVF1\nRhWkB9Juz/uoH9sr8pY7N8Csasr8Da9tgq93Q28taHLZBORJTQohhtetwCDi\n+DDud2siHih3sdtIHS5cvI/vvHW9Hbf9rN+4JyZLjVRDgztWKvZgUS0L0tlZ\ncP0//f4103SEG5Mki+h/Ihw3nt62YCMaCC2AMz4MiBk9+nZ+HVhlT56/jjN4\njiRjAd95kOnprZjbgXsXzvrMhbBnzqe+OLE+ge3Vvm9fwtwrtXXCgg80dBuJ\ng+kmygfzQnoDNMWvRw2OoD2FEeZL9H2bdpp4JQ/NmNPnmfgZhMqtHdUvq7B/\nZV0w\r\n=3r6v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGlL46wCNo1d9/YcvbiylIwYBTVANPFolrve5YS1IzD0AiAZoER0YeFayZE5YSRNKWnVi04RH4fB2/xaVNGQQX6DoQ=="}]},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"_npmUser":{"name":"akeri","email":"juancosta@alialabs.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loopback-mongo-aggregate-mixin_1.0.0_1550767698664_0.39340252459773106"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aliatech/loopback-mongo-aggregate-mixin","version":"1.0.1","description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","publishConfig":{"access":"public"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"scripts":{"lint":"eslint lib","lint-fix":"eslint --fix lib","test":"mocha","test-with-coverage":"nyc --reporter=text --reporter=text-summary --reporter=html mocha","publish-coverage":"nyc report --reporter=text-lcov | coveralls"},"main":"index.js","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"dependencies":{"lodash":"^4.17.11"},"devDependencies":{"@aliatech/eslint-config-aliatech":"^0.1.0","coveralls":"^3.0.2","eslint":"^5.13.0","loopback":"^3.25.0","loopback-boot":"^2.27.1","loopback-connector-mongodb":"^3.9.2","mocha":"^5.2.0","nyc":"^13.2.0","should":"^13.2.3"},"gitHead":"796457ede18b0f058b1513043b91017aa2eefa87","bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","_id":"@aliatech/loopback-mongo-aggregate-mixin@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"akeri","email":"juancosta@alialabs.com"},"dist":{"integrity":"sha512-ZyM9kOhfdATh4Dg49W2z0ol++TmLm+/PUjAEdpBpOMZ4DbitbF27p5zP1iIG/zhHBjfcSieQrvF0pn/u1meUPA==","shasum":"54fd2bf1490fbca36b1f51ab650e711bb515e666","tarball":"https://registry.npmjs.org/@aliatech/loopback-mongo-aggregate-mixin/-/loopback-mongo-aggregate-mixin-1.0.1.tgz","fileCount":31,"unpackedSize":192346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgs16CRA9TVsSAnZWagAAwLoQAKP4ARK4JOwI70IRGIkD\n+OA7LlDm/gA8OEyCB4h03cZbn67K9IVmi1q6ruK42vSiFTo6lnZTMdJq2Zkn\nNaxunqFW2veAauFJpVCt9mecoe6nYNtM6X2/LrOqxqJb+h3+gHcmfLr9WNFo\nbnZre70FiCdBb93mYDvJddXbwMhMcNpKVx36c+wsxAvudk1HBnYUXv3GrWVY\nnYlz+5NFpK6/OOZfmhkOpZyF4uFQixu+2loW5N8NaibCqHUuBTCtHCsloAzm\nu7JQRnuvOVxglGuz9pVnR/WUTi/oU0psQ+AndjI9NYF/Tm5z6ucJutcomvRj\nqKXLLDCJODDoSa81zx3X+GqIwIZWmE9qrRtWByypc6MLHva269uq7PASmhOE\noQc5ZaQEGRcwVMWqWC8wg/7932I+JuMf4Sh+1DtTaP5lh0uMCRHdOOymmTTO\nB+pVRCXsvXoVDMaB6xB9mjjUFR86PIkM43q/3Y7jVEe6l6WxuEUGNU1KLTIM\ncrW4UP8qKl5vBwaGVPr5U4BZiFabKnQ/SJsgTF6W7nddOkIDXIpz5ALRVrhX\nOPBeHHe8qzKE5n6YUgcZequYMCf7ZEknTVbiJaV8JlErygQQ3EwVhx6rlaLx\nUnYumA5o62MHjQlSCvbUlCDtdpDwmxCRt43YqZlefqo0tfn1ox2yJTah6xq0\nLNA0\r\n=6wTk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKQH1HQQZVHS8h7QwjzlvC9VsEVzxv/UtxAD9jloJE6AiBf3ZCDlJf0HRVA/CHvWXYmFbmNzqv9CZmjVd8gMWvN5g=="}]},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loopback-mongo-aggregate-mixin_1.0.1_1552076154253_0.6535327539852345"},"_hasShrinkwrap":false},"1.1.0":{"name":"@aliatech/loopback-mongo-aggregate-mixin","version":"1.1.0","description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","publishConfig":{"access":"public"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"scripts":{"lint":"eslint lib","lint-fix":"eslint --fix lib","test":"mocha","test-with-coverage":"nyc --reporter=text --reporter=text-summary --reporter=html mocha","publish-coverage":"nyc report --reporter=text-lcov | coveralls"},"main":"index.js","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"dependencies":{"lodash":"^4.17.11","polygoat":"^1.1.4"},"devDependencies":{"@aliatech/eslint-config-aliatech":"^0.1.2","coveralls":"^3.0.2","eslint":"^5.15.1","loopback":"^3.25.0","loopback-boot":"^2.27.1","loopback-connector-mongodb":"^3.9.2","mocha":"^5.2.0","nyc":"^13.2.0","should":"^13.2.3"},"gitHead":"cc49a04cc161a8b6fd4236cb31f6e49dfcae754d","bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","_id":"@aliatech/loopback-mongo-aggregate-mixin@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"akeri","email":"juancosta@alialabs.com"},"dist":{"integrity":"sha512-6EqWi7olUJ3MUddYocFHCXKIE/0/vjJ2Gn+QeWiizhT9uv4gF5NZtLp5v2G1WjgRAxqyNeNdJKdf7JCHGrF6Dw==","shasum":"f2dd7440f04043e98e32f99baca844a7efa01ad3","tarball":"https://registry.npmjs.org/@aliatech/loopback-mongo-aggregate-mixin/-/loopback-mongo-aggregate-mixin-1.1.0.tgz","fileCount":31,"unpackedSize":199839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclmjDCRA9TVsSAnZWagAAxVcQAJPFr6v0sKdNs26fs1UO\ngfO4pDMVpHebr2V4js3lTWBck8tpzxiQnYYeRBBeTlJYPc47coOtRcHwovrZ\n2IAV4w6vtET1Pkvp1MtQdyaC42VdkcopXDidwrominX6saa7EMEmMljdi8ET\ngsowTiDDakr/4m+AuksiOxHsEG1CVXwyFa2FlI3R4yhWUrgiJuieG3PsVRqg\nQdlixzb6R8vx7mPJBn88TqyZiucP9mCk5zDR9aSSefbsQxRlPX6DboNLKnkQ\nlYJ9nKGoqEKEh5egPAuDpZW4WPrnPss0hGNW0SDqyW/ABv2luS2o3l0ABNbI\nmqi77RVBnUmAqvsquQDdX45jlu186xcLhl+oO8SoKrFNlrWF6WQ1WemQsKUr\nJ9sNnF8B6OBDGuUQdXmG+gNReDQxJMQlhswVbQltQpz/jZKaKnp5oNHWpNCw\n+vC7e5eyiNPVeiYMkWZL6R5BsgFcIoSqaUpQERT0tPgs1YtVXXWDoOJIrRUt\nLHcbcLZVxB9Zf6yrsVM0gCguOP0es9UlQO7FHclRxOLekAv3ENYxPlxKDxfc\nbUaJrSKd6JTU0UyujKE+DZfMSf3QSyGF5P550BuqtIgUNmn2Rle+FdSKHEYS\nUngqS06MqqYgQEBV7z2bAxbruz7zZNWGpUaHG/m2uHbgGmwNgXbnRs8eWTSV\nI/T2\r\n=7LHo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHx6u0zAiGNfWEu6BW1IcIEc83tOYNgjpOJPcBt9H5HxAiEAv3bjkGAd4l8XB+ZyaXnkT7BYhq/WTLA3CqIEvd2u4Qc="}]},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loopback-mongo-aggregate-mixin_1.1.0_1553361090447_0.8192388990595543"},"_hasShrinkwrap":false},"1.1.1":{"name":"@aliatech/loopback-mongo-aggregate-mixin","version":"1.1.1","description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","publishConfig":{"access":"public"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"scripts":{"lint":"eslint lib","lint-fix":"eslint --fix lib","test":"mocha","test-with-coverage":"nyc --reporter=text --reporter=text-summary --reporter=html mocha","publish-coverage":"nyc report --reporter=text-lcov | coveralls"},"main":"index.js","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"dependencies":{"find-node-modules":"^2.0.0","lodash":"^4.17.11","polygoat":"^1.1.4"},"devDependencies":{"@aliatech/eslint-config-aliatech":"^0.1.2","coveralls":"^3.0.2","eslint":"^5.15.1","loopback":"^3.25.0","loopback-boot":"^2.27.1","loopback-connector-mongodb":"^3.9.2","mocha":"^5.2.0","nyc":"^13.2.0","should":"^13.2.3"},"gitHead":"6beacf77e904c41f7fb225b0246a1afc40281ea5","bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","_id":"@aliatech/loopback-mongo-aggregate-mixin@1.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+V0XXgKJIe+qJhSvX3MMqmfwkfKeUTqNJ1aSmRc/qobW2+HG8dvpyP/VpWgmMhp7zcWqPtrI6RoGznkc3jGXgA==","shasum":"24cb7c4d682d15e246079f19448bbbe96121a6c8","tarball":"https://registry.npmjs.org/@aliatech/loopback-mongo-aggregate-mixin/-/loopback-mongo-aggregate-mixin-1.1.1.tgz","fileCount":30,"unpackedSize":59840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjivUCRA9TVsSAnZWagAAjMEQAJMTV0HGiCGr45u6fz7u\n7r9uFOVbByw85qdwgXS47k0y1vwrwLBEjE8o3295dRCIO0GwIcTz4Y2zajso\nLmzxu3WYy+c8r8BKDjqja7GN5q8eutPrcsWOkuyHL0+1wx+Er3Uu4h70A7bp\nKbhTqNWxyrxGm8K7qCad3ZGOHFeWTHB0sHR/VKpDgpaKia92gAqeg1uYGy/E\nebIab4D1/c4HJEyEoYRbMFh7lz+OV6iiTxHwbhlTEvIek7HlMC5dEucssdHg\n0f/8Q21tK2Pr53yfQs/oRJP8PHfQ8JeXxhiORKj+v2fKID3QSlwHqQtgsByx\nR4WwxoG13pV16H65pDUQnNByX//+qTDjVEHpO/CTeKpixXapewEDV2FGM2MZ\nrpwPZkT2VtsCQLNFjsD+aH8IJ3y/Xv0undi6336kXpHiMjw6JnuOvfZzeEXd\nOVDIgVwdF0lqY2ZkWQ1B6IlzkkexRFPWKzSfNIad6jqhYh35fEl10JuW621F\n3gTz0hoa3PUSqwCxZHZrQdu26/oqWhxxjW/AImq53n/FzYtGttQgP+YuO7i3\nvtN6rCOq1mkL5+RqJe5B0m1vXOB9nvoTlVtA+fQHDVAfDIFnUJVz4NzNc79f\ngey+ox61511MQLnl4IdAJebpAHirtWE/6AkssGj4Yun1wIbYejPqVL/1H58Z\nxUjR\r\n=EDtJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1oAEHiL6yCiMnVYje+NR36pxJkeqhlPALfeQ36a/MgAIhAIcvAJv9yP/kFVRGHDo8AMGowuYlq6860YrJJ9fumH5y"}]},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"_npmUser":{"name":"akeri","email":"juancosta@alialabs.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loopback-mongo-aggregate-mixin_1.1.1_1569598420246_0.757186222789479"},"_hasShrinkwrap":false},"1.1.2":{"name":"@aliatech/loopback-mongo-aggregate-mixin","version":"1.1.2","description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","publishConfig":{"access":"public"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"scripts":{"lint":"eslint lib","lint-fix":"eslint --fix lib","test":"mocha","test-with-coverage":"nyc --reporter=text --reporter=text-summary --reporter=html mocha","publish-coverage":"nyc report --reporter=text-lcov | coveralls"},"main":"index.js","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"dependencies":{"find-node-modules":"^2.0.0","lodash":"^4.17.11","polygoat":"^1.1.4"},"devDependencies":{"@aliatech/eslint-config-aliatech":"^0.1.2","coveralls":"^3.0.2","eslint":"^5.15.1","loopback":"^3.25.0","loopback-boot":"^2.27.1","loopback-connector-mongodb":"^3.9.2","mocha":"^5.2.0","nyc":"^13.2.0","should":"^13.2.3"},"gitHead":"845fdc6487f7a816be2edcc41017f59265164b17","bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","_id":"@aliatech/loopback-mongo-aggregate-mixin@1.1.2","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-oWkAtZsC79D+65PlIOpeEKldLplB2Z0wk2QUYwx8RuruGdgstGqo2o/76lv375wkpJnJhxDgwmgtxqfAFCz0Ng==","shasum":"ac7b923e925a8fafe7e570abe689b92b1b97c1c8","tarball":"https://registry.npmjs.org/@aliatech/loopback-mongo-aggregate-mixin/-/loopback-mongo-aggregate-mixin-1.1.2.tgz","fileCount":30,"unpackedSize":61551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZqSmCRA9TVsSAnZWagAALXAP+gLUGzwqex+gViWBgQ+x\n/6f1Q9eS5Hy6ULHtlBSHVRVdhDKghCyZww8kjnefTDzh/HpJK0vRot+ODKg2\n9Kcs4AT/5twaKjA+HTrcIK/VFQXByMClGeHIZd8efcirivan2ZpULIqqZth5\nZS5EgFbwjHP6X5XIt0O18AUyKVMUdFNl254ceKOnXmuhcWqLQCOzuoFXvZZ7\nNFLdR74zdcYszz3kjAqRHud0OAVd85wwAtVC7kLUVWqnT4uit8TJKsIDg7jh\n0PRDta80ZCY1/DT37+guZ7iaaSagKp6CzyxV4w8ClSYtDKUvfZFz+KJzrwx3\nB5R2euh4POdrDAVaf6cOTckP4v5CMRuIaJnv5MR81DHcGwhrBmi7GjF9r/2W\niUP6yE6dBs2EJYbAN1thJoQ6t90d+fKlRPUt4rEFtBu0nqQU0iGPVCc4MV/q\nWJLRMG1Qg4F1nJP36CTmjIlhSOuRIwcvGMm5TUEYK4TTK6qiDVemQmukEYXr\n6/ESxL84jRwyQ/bdJ2nq/DYnmiiRkqYvFjan6GGfn8TrL27xQYHVObRQLyNY\nbPN5/gNoqBfOjLUnmwFK1NAoXDW6RSzzEs3b/j5cAWtJv64vk+s/ITwjrHHJ\n3YkdDds9GtF4SgF4zTzFx48mEl5LTs4bby7blD6aeYEdCUdr1J7YFLnPOdTa\nRP+u\r\n=rY2n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFX1hIKxN+e9YjcU2Lp1teJI1oPJ1AGOcPF2swjyfuj5AiEA3Zrlq1nluDINv7ohg+/0ynqkujCyDeiTixYravVcvWg="}]},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"_npmUser":{"name":"akeri","email":"juancosta@alialabs.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loopback-mongo-aggregate-mixin_1.1.2_1583785126312_0.5373946999796839"},"_hasShrinkwrap":false},"1.1.3":{"name":"@aliatech/loopback-mongo-aggregate-mixin","version":"1.1.3","description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","publishConfig":{"access":"public"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"scripts":{"lint":"eslint lib","lint-fix":"eslint --fix lib","test":"mocha","test-with-coverage":"nyc --reporter=text --reporter=text-summary --reporter=html mocha","publish-coverage":"nyc report --reporter=text-lcov | coveralls"},"main":"index.js","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"dependencies":{"find-node-modules":"^2.0.0","lodash":"^4.17.11","polygoat":"^1.1.4"},"devDependencies":{"@aliatech/eslint-config-aliatech":"^0.1.2","coveralls":"^3.0.2","eslint":"^5.15.1","loopback":"^3.25.0","loopback-boot":"^2.27.1","loopback-connector-mongodb":"^3.9.2","mocha":"^5.2.0","nyc":"^13.2.0","should":"^13.2.3"},"gitHead":"4df50a9cbd5ca770e55d96669fe2e52f84e745b7","bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","_id":"@aliatech/loopback-mongo-aggregate-mixin@1.1.3","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-zuelUnUxqFy4NC3apOt+qSrFhlI6pjxKTtbt8rMM2IoH9F+5zBbLo1mry2gWX0fL0C+uQm19nJudgb7VWxNqMQ==","shasum":"343d265fd8ac8b33647d3705a21398318a9479e5","tarball":"https://registry.npmjs.org/@aliatech/loopback-mongo-aggregate-mixin/-/loopback-mongo-aggregate-mixin-1.1.3.tgz","fileCount":32,"unpackedSize":65704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebSLbCRA9TVsSAnZWagAARaYP/1D3brw837o7QeE+Fcj+\nseLZPBRGdOygcsIetjbe2SLuVX/8vjqsbNEBpGm5dwHNrYCA/wf82UruU89E\nSGS7Lt8ZnhSxwB4itl0H5y5/gXNJ3m/dQ8fQcYL6/MG8XKJAWptqOup4LlZX\nsRt/FOqj4ZJXMWukMPHq4oBsYMMKU7sLpDlz4Gdd40GSmHvEI0Z/+UIwX0hP\n2YKJojUtzT+PSflhs9jX540jfbDUA1gzk4K9nJzRScxguGhyI2VGgn+ULTN3\nbLZlhOGIJ18inBbaYjpe5CVFcwU2EYrQFhWMz4uQraIZ9HJDbjWIWhn0JWeQ\niuurEohIgqi6gPN+kzz/NWqpaj3ZoiqUadpDHatgY7Q1lCoaYznWX70YpceC\nlWhDOyyCBcIgLgGJh2kt/WN2fq/nzsPu3hK5MDRVdbDsaH6RT1MODLPiMVYD\n7mZ8cdta2wfUtpl26akosQKIZ/W6SGne0xutNinE28EY+4WYujrsHBxEIobM\nfCmbi7ZO1/tNDaPIKhV8uIYLBkEsMMHi6yHd3diH8vwmbeb+V2pyqi1ojzDo\nwkrzsVurhgfJgNT7IbTxjp8Div7PIjpCadOdP/JqKLd5xRTEU+I5DUQ5W7mX\nir8NmaDDfm1BsRPQ9KtcUgvO5DaAvIAdqMh1R94/KxS7RKT/ZidVCpUUJT4B\nAW2N\r\n=usMx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGgotmZLtuz67HB1PzzNz4q/KiQMWJD+60/Fu7DFW6w3AiA9e1YeFJUYZjUlJLH1+DqoEVFSgv4cVIijpBPSH0jAMQ=="}]},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"_npmUser":{"name":"akeri","email":"juancosta@alialabs.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loopback-mongo-aggregate-mixin_1.1.3_1584210650801_0.8293059891805805"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-21T16:48:18.483Z","1.0.0":"2019-02-21T16:48:18.859Z","modified":"2022-04-04T12:53:36.260Z","1.0.1":"2019-03-08T20:15:54.442Z","1.1.0":"2019-03-23T17:11:30.572Z","1.1.1":"2019-09-27T15:33:40.378Z","1.1.2":"2020-03-09T20:18:46.440Z","1.1.3":"2020-03-14T18:30:50.969Z"},"maintainers":[{"name":"akeri","email":"juancosta@alialabs.com"}],"description":"Loopback mixin to query MongoDB aggregation pipeline and build the instances from results","homepage":"https://github.com/aliatech/loopback-mongo-aggregate-mixin#readme","keywords":["node","loopback","mixin","orm","mongodb","aggregate","aggregation","pipeline"],"repository":{"type":"git","url":"git+https://github.com/aliatech/loopback-mongo-aggregate-mixin.git"},"author":{"name":"Juan Costa","email":"juancosta@alialabs.com","url":"ALIA Technologies"},"bugs":{"url":"https://github.com/aliatech/loopback-mongo-aggregate-mixin/issues"},"license":"MIT","readme":"# Loopback Aggregate mixin for MongoDB\n\n[![Build Status](https://travis-ci.org/aliatech/loopback-mongo-aggregate-mixin.svg?branch=master)](https://travis-ci.org/aliatech/loopback-mongo-aggregate-mixin)\n[![Coverage Status](https://coveralls.io/repos/github/aliatech/loopback-mongo-aggregate-mixin/badge.svg?branch=master)](https://coveralls.io/github/aliatech/loopback-mongo-aggregate-mixin?branch=master)\n[![npm version](https://img.shields.io/npm/v/@aliatech/loopback-mongo-aggregate-mixin.svg?color=blue)](https://www.npmjs.com/package/@aliatech/loopback-mongo-aggregate-mixin)\n<!--![npm total downloads](https://img.shields.io/npm/dt/@aliatech/loopback-mongo-aggregate-mixin.svg?color=9cf)-->\n\nGive models the ability to query native **MongoDB aggregates** and **build instances** from results.\n\n**Highlights**\n\n* Accepts both Loopback filter's features and pipeline stages, it will merge in a single parsed pipeline to aggregate.  \n* Accepts relations' fields within the root where, it will be handled as $lookup stages.\n* Refactor the logic from Loopback which is responsible for building the model instances and take advantage of it.\n* Supports both callbacks and promises.\n\nThis Loopback mixin is intended to be used together with MongoDB connector.\nWorks for Loopback 2 and 3.\n\n## How to install\n\nInstall the package through NPM\n\n```bash\nnpm i -S @aliatech/loopback-mongo-aggregate-mixin\n```\n\nInstall the package through Yarn\n\n```bash\nyarn add --prod @aliatech/loopback-mongo-distinct-mixin\n```\n\n## Basic configuration\n\nInclude the mixin in `server/model-config.json`. Example for Loopback 3:\n\n```json\n{\n  \"_meta\": {\n    \"sources\": [\n      \"loopback/common/models\",\n      \"loopback/server/models\",\n      \"../common/models\",\n      \"./models\"\n    ],\n    \"mixins\": [\n      \"loopback/common/mixins\",\n      \"../node_modules/@aliatech/loopback-mongo-aggregate-mixin/lib\",\n      \"../common/mixins\"\n    ]\n  }\n}\n```\n\nEnable the mixin in your model definition, ie `person.json`.\n\n```json\n{\n  \"name\": \"Person\",\n  \"properties\": {\n    \"name\": \"string\"\n  },\n  \"mixins\": {\n    \"Aggregate\": true\n  }\n}\n```\n\n## Usage\n\nInvoke `aggregate` method passing either:\n\n* A regular Loopback filter (where, fields, include, order, skip, limit)\n* An aggregate pipeline\n* A combination of both\n\n### Basic example\n\n> Find a random sample of 3 persons born after 1980:\n\n```js\napp.models.Person.aggregate({\n  where: {birthDate: {gt: new Date('1980')}},\n  aggregate: [{$sample: {size: 3}}],\n}, (err, persons) => {\n  if (err) return next(err);\n  // persons are Person model instances\n});\n```\n\n### Find where relation properties\n\nRelation properties can be specified in the \"where\" criteria using dot notation.\n$lookup stages will be automatically generated to reach those relations and filter the root documents by such criteria.\nit works like a \"LEFT JOIN\" feature, however it's still necessary to add the \"include\" filter\nif you require the relation to be hydrated.\n\n> Example: Bring persons who are part of a team in which there is some person who is born after 2001\n\n```js\napp.models.Person.aggregate({\n  where: {'team.persons.birthDate': {$gt: new Date('2001')}},\n}, (err, persons) => {\n  if (err) return next(err);\n  // persons are Person model instances\n});\n```\n\nNote: It works for hasOne, belongsTo and hasMany. Filtering by embedded properties is not affected and continues to work as usual.\n\n### Do not build instances\n\nSome queries are intended to retrieve data that can not be transformed into model instances.\n`aggregate` method will attempt to build instances by default, but this behavior can be disabled\npassing an options object `{build: false}` as second argument.\n\n> Example: Bring count of persons by company\n\n```js\napp.models.Person.aggregate({\n  aggregate: [{\n    $group: {\n      _id: '$companyId',\n      total: {$sum: 1},\n    },\n  }],\n}, {build: false}, (err, groups) => {\n  if (err) return done(err);\n  // Each group should be a plain object with just 'id' and 'total' attributes  \n});\n```\n\n### Build instances on demand\n\nThe aggregate result often needs some processing before building the model instances.\nIt's possible to postpone the build phase until the models' data are resolved. \n\n> Example: Bring the persons count together with a specific page\n\n```js\nPerson.aggregate([{\n  group: {\n    _id: null,\n    total: {$sum: 1},\n    objects: {$push: '$$ROOT'},\n  },\n}, {\n  project: {\n    total: 1,\n    items: {$slice: ['$objects', pageStart, pageLength]},\n  },\n}], {buildLater: true}, (err, [data, build]) => {\n  if (err) return next(err);\n  // data is a plain structure {total, items} where items is an array of documents, not model instances. \n  build(data.items, (err, persons) => {\n    if (err) return next(err);\n    // now you got persons as Person model instances\n  });\n});\n``` \n\n* In this case, model documents are not brought as root result,\nso we could disable the automatic building by just passing the option `{build: false}`,\nbut in this case, what we really need is the option `{buildLater: true}`.\n* The difference is that `buildLater` will provide us a build function (together with native documents) to invoke by our hand .\nPerson instances will be finally obtained by calling such function passing `data.items`.\n* Build on demand feature it's available as a model static method `Model.buildResult`.\n\nNote: Pipeline array can be directly passed as argument. Also stage names can obviate \"$\" character.\n\n### GeoNear example\n\nCombine regular \"where\" with $geoNear stage.\n$geoNear will be moved to the pipeline head as MongoDB requires.\n\n```js\napp.models.Company.aggregate({\n  where: {sector: 'Software'},\n  aggregate: [{\n    $geoNear: {\n      near: {type: 'Point', coordinates: [-0.076132, 51.508530]},\n      distanceField: 'distance',\n      maxDistance: 5000, // 5Km.\n      spherical: true,\n    },\n  }],\n}, (err, companies) => {\n  if (err) return done(err);\n  // companies are Company model instances\n});\n```\n\n### Promise support\n\nMethods `aggregae` and `buildResult` support either callback or promise usage.\nAll the examples above are made with callbacks.\nBelow it's shown how it's made with promise style.\n\n> Example: Find a random sample of 3 persons born after 1980:\n\n```js\napp.models.Person.aggregate({\n  where: {birthDate: {gt: new Date('1980')}},\n  aggregate: [{$sample: {size: 3}}],\n}).then((persons) => {\n  // persons are Person model instances\n}).catch((err) => {\n  // handle an error\n});\n```\n\n> Same example using await\n\n```js\ntry{\n  const persons = await app.models.Person.aggregate({\n    where: {birthDate: {gt: new Date('1980')}},\n    aggregate: [{$sample: {size: 3}}],\n  });\n} catch(err) {\n  // handle an error\n}\n```\n\n\n## Advanced configuration\n\nEnable the mixin passing an options object instead of just true.\n\n**Available options:**\n\n| Option                | Type      | Required  | Description                                                                                                                                                                                                                                                                                           |\n| --------------------- | ----------| --------- | ----------------- |\n| mongodbArgs           | object    | optional  | Set defaults for MongoDB aggregate command options (default `{}`). Check the [official documentation](https://docs.mongodb.com/manual/reference/command/aggregate/ \"Link to documentation\") |\n| build                 | boolean   | optional  | Whether to automatically build model instances from aggregate results by default. (default `true`) |\n| buildOptions          | object    | optional  | Set defaults for building process options (default `{notify: true}`) |\n| buildOptions.notify   | boolean   | optional  | Whether to notify model operation hooks on build by default (default `true`) |\n\nAny of these options can be replaced on the fly with the following syntax:\n\n```js\napp.models.Person(filter, options, callback);\n```\n\nThe `options` argument will be timely merged with the defaults for a single call. \n\n### Example: Allow MongoDB to use disk\n\nThis is a MongoDB aggregate command option that prevent memory issues on large queries.\nIt can be enabled by default as follows:\n\n```json\n{\n  \"name\": \"Person\",\n  \"properties\": {\n    \"name\": \"string\"\n  },\n  \"mixins\": {\n    \"Aggregate\": {\n      \"mongodbArgs\": {\n        \"allowDiskUse\": true\n      }\n    }\n  }\n}\n```\n\nOr just enable the option on the fly for a single call:\n\n```js\napp.models.Person(filter, {mongodbArgs: {allowDiskUse: true}}, callback);\n```\n\n# Debug\n\nPrepend DEBUG environment when running server or tests to display what pipelines are being sent to MongoDB:\n\n```bash\nDEBUG=loopback:mixins:aggregate node . # Run server with debug\n```\n\n# Testing\n\nInstall develop dependences\n\n````bash\nnpm i -D # If you use NPM\nyarn install # If you use Yarn\n````\n\nExecute tests\n\n````bash\nnpm test # Without coverage check\nnpm run test-with-coverage # With coverage check\n````\n\n# Credits\n\nInspired by [https://github.com/BoLaMN/loopback-mongo-aggregate-mixin](https://github.com/BoLaMN/loopback-mongo-aggregate-mixin \"Github's repository\")\n\nDeveloped by\n[Juan Costa](https://github.com/Akeri \"Github's profile\")\nfor\n[ALIA Technologies](https://github.com/aliatech \"Github's profile\")\n\n[<img src=\"http://alialabs.com/images/logos/logo-full-big.png\" alt=\"ALIA Technologies\" height=100/>](http://alialabs.com \"Go to ALIA Technologies' website\")\n","readmeFilename":"README.md"}