{"_id":"@asta-kun/sailsv1-hook-mongoat","_rev":"1-3434ef3410689e7b62b83cacb666c93d","name":"@asta-kun/sailsv1-hook-mongoat","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@asta-kun/sailsv1-hook-mongoat","version":"1.0.0","description":"Provides advanced mongo indexing options for sails models that use the sails-mongo adapter.","main":"index.js","sails":{"isHook":true},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/teamfa/sails-hook-mongoat.git"},"keywords":["sails","mongo","index","expires","expiresAfterSeconds","unique","sparse","background","weights","text","2d","2dsphere","geoHaystack","waterline"],"author":{"name":"Team FA"},"license":"MIT","dependencies":{"async":"^1.0.0","lodash":"^3.9.3"},"bugs":{"url":"https://github.com/asta-kun/issues"},"homepage":"https://github.com/asta-kun#readme","gitHead":"8ee3b9802bf948801401e70a66b658d4b7c7a554","_id":"@asta-kun/sailsv1-hook-mongoat@1.0.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9OrcoKsH77IB8dVoImKhbPAdDtozMNpK0JHqv90Ymo32YhjIEP5wnwtE19ptYOKB1yIqMno/ryVQ8Mqu95+WEw==","shasum":"86f3413d8aee3554b26dbf3dffa76ffdb0015011","tarball":"https://registry.npmjs.org/@asta-kun/sailsv1-hook-mongoat/-/sailsv1-hook-mongoat-1.0.0.tgz","fileCount":4,"unpackedSize":7311,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflPVMCRA9TVsSAnZWagAAmBkP/2fvBQgZlgzl2+0UJtUz\n+1u3Aw9rW1cYF9ePCrTRU1TlJzr4tRz7KqzqaYEYjZGXyInuXboJDCPFHNat\ncND6DYGlJKuGrSA/GvrkNuf1jX11IvXyNAx/pxxegx8apWhJlGEdLgOAedYw\nQF5Rg8WNHJY9/oBwqTg8cir7YxuEo2h1tJ/iqhBHkbqj2FvQG7nimfcJLlNe\naNbFbWrcaX4A/VNGggqCNodk+Lc4aZKGzoQRSRonEjO3GoLZExwbbFPLUQHO\neCh/CLwEdNbj5J8n2KdRE+zg+0mW9y0ZaTAZ8SeuMjFWWR62EVpSzWqangbB\ny2UqJtIsRTE3xt4MCmdHb7MVIl+PFQzOz88GWyDkV4eJOR+00/aURl2yUuFU\nBu6i5KTqEZtnSjjByyeBM6/E17pLtWp3GMSTDfu/BhXantZnImFoX+j4Btvq\nj6NMmVclrhy5n+t8ZtLgQvWK0HZtnPEgibT8osYgNWWoY2y3KvNcjZdQjqoY\nIfNyXdFLCOZ28sfCpFtrcSPK7IBntURhiqJjgrQhAu51A6nzaQn4Ri2y62v2\nVpZffq3P26HOKnVa+dRSrOqvhGF1NJ10b1VoxzMFel/2QcmLddN3BU95z5yE\nNu1AqPc0D/G+Coogxf6F/kxvUe8wwHDxuujXRKHupxKcsvln4hyomRd3tu5l\n3Lbl\r\n=wSut\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFODKl2bUCtd8+ysFzbR7IsAYV2B5d6iy4tqSCGyNTGUAiEAtsQYzgLeN3JY1fzw9SGoJWBIW+RT36m3IYp/FP16N/g="}]},"maintainers":[{"name":"asta-kun","email":"hectordev1999@gmail.com"}],"_npmUser":{"name":"asta-kun","email":"hectordev1999@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sailsv1-hook-mongoat_1.0.0_1603597643694_0.7930093334115418"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-25T03:47:23.639Z","1.0.0":"2020-10-25T03:47:23.853Z","modified":"2022-04-04T15:51:58.258Z"},"maintainers":[{"name":"asta-kun","email":"hectordev1999@gmail.com"}],"description":"Provides advanced mongo indexing options for sails models that use the sails-mongo adapter.","homepage":"https://github.com/asta-kun#readme","keywords":["sails","mongo","index","expires","expiresAfterSeconds","unique","sparse","background","weights","text","2d","2dsphere","geoHaystack","waterline"],"repository":{"type":"git","url":"git+https://github.com/teamfa/sails-hook-mongoat.git"},"author":{"name":"Team FA"},"bugs":{"url":"https://github.com/asta-kun/issues"},"license":"MIT","readme":"# sails-hook-mongoat\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Dependency Status][daviddm-image]][daviddm-url]\n\nProvides advanced mongo indexing options for sails.js models that use the sails-mongo adapter.\n\n## Usage\n\n    npm i sails-hook-mongoat\n\nThen simply add an 'indexes' array property to your sails model(s) that you want to add custom indexers on.  This contains all your indexes.\n\nIndex properties:\n\n - **attributes** - an object with the attributes to index (can also be text indexes)\n - **options** (optional) - index options (see [Mongo Index Options](http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/#options-for-all-index-types))\n\n## Examples ##\n\n**Creating a 'expires after' index**\n```javascript\n// MY MODEL WITH A DATE FIELD\nmodule.exports = {\n  attributes: {\n    myDate: {\n      type: 'date',\n      required: true\n    }\n  },\n  indexes: [\n    {\n      attributes: {\n        myDate: 1\n      },\n      options: {\n        expireAfterSeconds: 60  // expire 60s after myDate\n      }\n    }\n  ]\n};\n```\n\n\n**Creating a composite unique index**\n```javascript\n// MY EVENTS MODEL\nmodule.exports = {\n  attributes: {\n    event_id: {\n      type: 'integer',\n      required: true\n    },\n    match_id: {\n      type: 'integer',\n      required: true\n    }\n  },\n  indexes: [\n    //event & match composite index\n    {\n      attributes: {\n        event_id: -1,    // desc\n        match: 1         // asc\n      },\n      options: {\n        unique: true\n      }\n    }\n  ]\n};\n```\n\n## Maintained By\n- [Mike Diarmid](https://github.com/salakar)\n\n<img src='http://i.imgur.com/NsAdNdJ.png'>\n\n[npm-image]: https://img.shields.io/npm/v/sails-hook-mongoat.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/sails-hook-mongoat\n[travis-image]: https://img.shields.io/travis/teamfa/sails-hook-mongoat.svg?style=flat-square\n[travis-url]: https://travis-ci.org/teamfa/sails-hook-mongoat\n[daviddm-image]: http://img.shields.io/david/teamfa/sails-hook-mongoat.svg?style=flat-square\n[daviddm-url]: https://david-dm.org/teamfa/sails-hook-mongoat\n","readmeFilename":"README.md"}