{"_id":"cache-manager-mongoose","_rev":"14-55daa2721a4958c30d76ffaf1c696a47","name":"cache-manager-mongoose","description":"mongoose store for node-cache-manager","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"cache-manager-mongoose","version":"0.0.1","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^1.4.0","chai":"^3.5.0","eslint":"^1.10.3","mocha":"^2.4.5","mongoose-mock":"^0.4.0","sinon":"^1.17.3"},"gitHead":"9f172c3a78e382f2fb3806fce1cf1b10f239ae0e","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@0.0.1","_shasum":"dec15f1057ef90dd256fe288e471a7331017a6df","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"dist":{"shasum":"dec15f1057ef90dd256fe288e471a7331017a6df","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-0.0.1.tgz","integrity":"sha512-HzATuoABQk7qiK2WfRE56FQ/+Zwx+FMDHigVeBj9lxCaVXicIKHlD/xz4mWfOnIczZqDavaup2HGug+P8mTOzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTFdhAHGVOCGn557SKbAsvknDJaSZqqeoncsyCPHjUOQIhAK3iNkbxU96NoOj9QI+YLf0xlr71B7cpmW45R8uHfEx1"}]},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/cache-manager-mongoose-0.0.1.tgz_1460883214218_0.36714516091160476"},"directories":{}},"0.0.2":{"name":"cache-manager-mongoose","version":"0.0.2","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^1.4.0","chai":"^3.5.0","eslint":"^1.10.3","mocha":"^2.4.5","mongoose-mock":"^0.4.0","sinon":"^1.17.3"},"gitHead":"71b2e2a57a36956b4d0ed8a108eac4f9b7d56869","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@0.0.2","_shasum":"0d8cea71707b147388c800b661246bb8efbfea1a","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"dist":{"shasum":"0d8cea71707b147388c800b661246bb8efbfea1a","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-0.0.2.tgz","integrity":"sha512-P1kfZeYDPlIXZw7hmIbdV0pUt6ylfTn/T0aBbbHhRkW/6auj0NNYDVQhFJpIdLxda/L67KoZwTvO3it6J+nVvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBy87WrbvWJhyYZiKOerJvkwctj0TceCYrc8qYsLOj+AiEA2HheAsB2Wj6et8UD8MwGJex+scPuOQcS34K6PVPCisE="}]},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/cache-manager-mongoose-0.0.2.tgz_1476527705558_0.38409792142920196"},"directories":{}},"0.0.3":{"name":"cache-manager-mongoose","version":"0.0.3","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^2.2.0","chai":"^3.5.0","eslint":"^3.11.1","mocha":"^3.2.0","mongoose-mock":"^0.4.0","sinon":"^1.17.3"},"gitHead":"ba041839d4f1207d04514660173ae1ff0644588c","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@0.0.3","_shasum":"8da0e8ca83868c7ca31dfc81fd62536b58725696","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"dist":{"shasum":"8da0e8ca83868c7ca31dfc81fd62536b58725696","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-0.0.3.tgz","integrity":"sha512-utIjCzL8K7FN0e5D+ZbsIwju7HQSg63h6AMSOhY3niLUPqtq5Uhd32Run4xyVsBETq1DSAekAHfMrzFxA4SGhg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCblKCL3FT8PoCf37GLYOOPewCZmof/daSQLuizEkKOfAIgQv6lqATZPWOX+muEyqTNzoNNon6fNfOhq1YTlRUy12s="}]},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/cache-manager-mongoose-0.0.3.tgz_1480626551917_0.14070712542161345"},"directories":{}},"0.0.4":{"name":"cache-manager-mongoose","version":"0.0.4","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^2.2.0","chai":"^3.5.0","eslint":"^3.11.1","mocha":"^3.2.0","mongoose-mock":"^0.4.0","sinon":"^1.17.3"},"gitHead":"c8fe46b6677e8841be73db0e2141678cf64a86e5","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@0.0.4","_shasum":"090e872fde48ddd01403e8130d7f3f67631985d0","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"dist":{"shasum":"090e872fde48ddd01403e8130d7f3f67631985d0","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-0.0.4.tgz","integrity":"sha512-GnOFN4e7QWXgPa1AMrw1oKYVNqrFYizS9wIpepTPiG2WAW0T35ZQlPE99ENqMy2R7/vMWatBf06tM4j+XU9FnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfVGLdc7CMT7xZy7fGShHWyV27WItK23R/xFp1OClAkQIhAJQQB+mRyu+RcMNRC7QFPQgIL6W06FcY1xuDl+g6XF7r"}]},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/cache-manager-mongoose-0.0.4.tgz_1482352209777_0.5304633898194879"},"directories":{}},"0.1.0":{"name":"cache-manager-mongoose","version":"0.1.0","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^2.2.0","chai":"^3.5.0","eslint":"^3.11.1","mocha":"^3.2.0","mongoose-mock":"^0.4.0","sinon":"^1.17.3"},"gitHead":"cf7858f0b6537d36d7b2495f620bc223ab93d5bd","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@0.1.0","_nodeVersion":"14.16.0","_npmVersion":"7.16.0","dist":{"integrity":"sha512-kaNny5/3z+rl8BO/eYHX21/+pNE0fwiTPTc5r33+Yq11bnzitSss1lcCJOEC/uPqQCpyp4GOzQnGj0/z63TU8A==","shasum":"2ebee6fad4ac8d4bcf9c20cd5b5834208abbcceb","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-0.1.0.tgz","fileCount":3,"unpackedSize":7794,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw3T76327y+oFeiNLRFGcZ3g9wn8Kpw2clYdXxVR6XXQIhAKeW6wRpAbxeHYX4cZhkjZMHsX2aaaHT/RfcotYh+mZR"}]},"_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"directories":{},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-manager-mongoose_0.1.0_1633030386874_0.8173260565709102"},"_hasShrinkwrap":false},"0.2.0":{"name":"cache-manager-mongoose","version":"0.2.0","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^2.2.0","chai":"^3.5.0","eslint":"^3.11.1","mocha":"^3.2.0","mongoose-mock":"^0.4.0","sinon":"^1.17.3"},"gitHead":"a3ea0e4d49b6259026faa2ceb04e63437724a8ca","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@0.2.0","_nodeVersion":"14.16.0","_npmVersion":"7.16.0","dist":{"integrity":"sha512-SEL2E+U52IUoBKT3IRD3lg/PVvin+qqNremrxl66JaZZB2pZnEXieT2BaiJkDUdji6BolUiIO8nIJnfbVygSYg==","shasum":"1dfdefc7098e2d39926fc10776451e54e3c48e11","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-0.2.0.tgz","fileCount":3,"unpackedSize":7801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAs/8WI4G5CxPVWl8d+g1jE1xRkYIOCllOIB+ORL8TmnAiEAxKboSooopmqLJCZ9ZhCbjYhsybsZtnyTn1+mUlHND6w="}]},"_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"directories":{},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-manager-mongoose_0.2.0_1634978236763_0.8371014031589352"},"_hasShrinkwrap":false},"1.0.0":{"name":"cache-manager-mongoose","version":"1.0.0","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"npx mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"MIT-0","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^2.2.0","chai":"^4.3.4","eslint":"^7.32.0","mocha":"^9.1.3","mock-mongoose":"^8.0.1-a","sinon":"^11.1.2","sinon-test":"^3.1.1"},"gitHead":"a9fc5fada676d88728470c716e990b12e8467764","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@1.0.0","_nodeVersion":"14.16.0","_npmVersion":"7.16.0","dist":{"integrity":"sha512-dfwsLJCAkwQQKy57QnX2RuWQhTTk2iAh+fQjF0DbDk+vlCsJ9mHVjrvRn4USCNvPEK6TWxQn8uIQogxXqHzSsg==","shasum":"1a44558155608aa9e10fe8c5d3bac23285ae66aa","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-1.0.0.tgz","fileCount":4,"unpackedSize":9099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2lWUCRA9TVsSAnZWagAAsgoP/jCJhyEdnTW7fJQNz47T\nFyxjZ+zT2MMji8hDU4rmzWS9t2Su9dTUm1MeKxVP4FvRIC7OK2w/6Lgd3ZB7\nPmu94RKBGOChsPIdiMiRcLPguPeA+wOgJg7067TPm9R4tvWb2IgfpTb0Hp3w\nvu49qtHayRmtYPx6KsV4B/1uOB+I8DNzLJlRrFdl69fseYVGN0PuvVV0AutA\nsKFaxMCkuH3aMyD0aMNK/nuphFVakZXo0+ApDZpiGlMF4IVFsGF2kRxQnuuL\naFWRysbGt1S+INpgPEUkqRjEKWYE0YU2vTy8wRMlJ+ib5Qq5KeX/Re9lb5l7\nuvYbmRXFB9cDDafJAjGu0ju90g3yMmmAKNTfU7jMJ4NTXDUMSeAJWiFcLvbf\nEqwsqisonqxCC18MK80F6AnugbKf+xJ9Vg0gLe3WukVrMSsvBdFsmpqOvexL\nIQ7n/VZB8PcGFLqPLQNmDWkPQQEZsSd1tGa+74yOezdXVJSQ21+BYxmm8B84\nr6I3gF3BlvW0vfH0s7BlMq4yOzGdrUS/eTzjnZ/jFCujV61UzcA0CSGrj6zB\nLO7k3iVSb/e7Dh62FtgAXIvlg6/re/SBLaJ8fXfE2JR9YAJ5hS1lo07IKYOY\nqIVUY7bCgT8w3X3crNnZL9xcomd2N7hHjBb/0fp34GZbpPvGGatlYLxEt8C2\nuxnY\r\n=JLQV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuijp0RzG1JSfqoQ4t3CUWwI/8H+7bq6JlmAwyRZmFMQIhAILu5n0vmb3FTOJZXnqT4cKLhPrhUMaGKkBdy7/Ft+xa"}]},"_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"directories":{},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-manager-mongoose_1.0.0_1634983934651_0.12721940401174092"},"_hasShrinkwrap":false},"1.0.1":{"name":"cache-manager-mongoose","version":"1.0.1","description":"mongoose store for node-cache-manager","main":"src/index.js","scripts":{"test":"npx mocha"},"keywords":["cache","mongoose","cache manager"],"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"license":"MIT-0","repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"devDependencies":{"cache-manager":"^2.2.0","chai":"^4.3.4","eslint":"^7.32.0","mocha":"^9.1.3","mock-mongoose":"^8.0.1-a","sinon":"^11.1.2","sinon-test":"^3.1.1"},"gitHead":"c50d32086cdce3c40e41357140076f4bb9c04ae5","bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","_id":"cache-manager-mongoose@1.0.1","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-oWYgRQ2hPYOZI5No0GdOpxufySn+RkV/MxQtPVmgY6Q06e7S3nohzWvXDlQFRd/f0l39CJxDp7poofOAag9+kg==","shasum":"c75705ff3ade1f31058fe85b31e54ff1f7dfb94c","tarball":"https://registry.npmjs.org/cache-manager-mongoose/-/cache-manager-mongoose-1.0.1.tgz","fileCount":4,"unpackedSize":9122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGY7MTgt5tJt8fDLTRaclOhfPE9ATfm3gs5x7Q9si4kjAiEA0k6NvinZKIymY3U5i+3qnq8pHRFClwoQ7KlEsFjZMwY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJif0QrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFGg//awtnG+WaBnFgly2wTxWD14/sLzQjddnYGPPyN6AlQ1WJrqPq\r\nrS+oyNHmBKUKllO9hvqI/2/PDmIxWbJhpqvT3eKiWb/epB00mR/Ay9fT1BHE\r\nzUNEX7ToryG+xXP3q4dyh+q2iLn2l8T43yySI9uYLPnDd/Hp3CuRhttxr5wz\r\n7Hclwdj8PVBNAwzb7tf3CM8nFWr6P0YV5mPHrxSXUy1Orkx4h+hHYaMAG6Yl\r\nOsSeF+SkaJ7LSEfMIThA3p959P1fWC9eqD+yDEbPorN/tyJ34jrS5VL29KJO\r\naHY8THei1MikuQ17poPXP8xmKshVkDGKewfjNehYGtC+eZQsuGtlRKmqPxdH\r\nHkpsp6QfhWnozXE2qPi4TasIdqCyjpBrqzPPBZ073k+ipPNHkfiRJmiURGfo\r\nS18tr9wbzdRceoL6IGqiU3ORFe4oUO10D0pNr4UZhrV99m38Nklc4J96/ECV\r\nle3KppYPRHByF3IuJW5QIL5aMb2HhRZuxH6+T6QyA3Mj1U690NCXHDJYXtzc\r\nmXIbqXR8Ka78Mmv72s656eudP7x3RRlp1ghGBaMgEQy69/iExiT8huXHRhCB\r\nYs9v5mF/EeQrmbsNFfN4tpnH06qfWXAtbimT67tNtFfR3W0h/QOxDyGRJcum\r\nWQT+WAhURd/x02HQgmI0+DEGzhOmXobN9is=\r\n=QAxQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"disjunction","email":"or@pluseq.com"},"directories":{},"maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-manager-mongoose_1.0.1_1652507691517_0.8831015023601594"},"_hasShrinkwrap":false}},"readme":"[![build status](https://api.travis-ci.org/disjunction/node-cache-manager-mongoose.png)](https://travis-ci.org/disjunction/node-cache-manager-mongoose) [![NPM version](https://badge.fury.io/js/cache-manager-mongoose.png)](http://badge.fury.io/js/cache-manager-mongoose) [![Coverage Status](https://coveralls.io/repos/github/disjunction/node-cache-manager-mongoose/badge.svg?branch=master)](https://coveralls.io/github/disjunction/node-cache-manager-mongoose?branch=master)\n\n# cache-manager-mongoose\n\nMongoose store for node-cache-manager (See https://github.com/BryanDonovan/node-cache-manager)\n\nOriginally created as an alternative to node-cache-manager-mongodb store\nto be able to use an existing mongoose connection.\n\n\n## Usage examples\n\nThis store expects that the mongoose instance is provided explicitely.\n\nIt is not a concern of this module to establish a connection,\nbut it rather assumes that you already have one and use it in your project.\n\n\n```javascript\nconst\n    mongoose = require(\"mongoose\"),\n    cacheManager = require(\"cache-manager\"),\n    mongooseStore = require(\"cache-manager-mongoose\");\n\nmongoose.connect(\"mongodb://127.0.0.1/test\");\n\nconst cache = cacheManager.caching({\n    store: mongooseStore,\n    mongoose: mongoose\n});\n\n// now you can use cache as any other cache-manager cache\n\n```\n\n### Options\n\nAll optionas are **optional**, except for `mongoose` instance.\n\nThe store creates a new Model on initialization, which you can partially customize. See example:\n\n```javascript\nconst cache = cacheManager.caching({\n    store: mongooseStore,\n    mongoose: mongoose, // mongoose instance\n    modelName: \"MyModelName\", // model name in mongoose registry\n\n    // options for model creation\n    modelOptions: {\n        collection: \"cacheman_rcp\" // mongodb collection name\n        versionKey: false // do not create __v field\n    },\n\n    ttl: 300 // time to live - 5 minutes (default is 1 minute),\n\n    connection: connection, // provide only when using mongoose.createConnection()\n});\n```\n\nIf you want to keep your cache **forever**, set TTL to zero (`0`)\n\nThe default modelOptions are:\n```json\n{\n    \"collection\": \"MongooseCache\",\n    \"versionKey\": false,\n    \"read\": \"secondaryPreferred\"\n}\n```\n\n### Custom model\n\nYou can also provide your own model as long as it has the same\nfields as the one used by default.\n\nIn this case you don't need to provide a `mongoose` instance,\nas all it boils down to is a model object.\n\nHere is an example:\n\n```javascript\nconst schema = new mongoose.Schema(\n    {\n        // standard fields\n        _id: String,\n        val: mongoose.Schema.Types.Mixed,\n        exp: Date,\n\n        // all other fields you like\n        foo: String,\n        bar: Number\n    },\n    {\n        collection: \"my_collection\",\n        versionKey: false\n    }\n);\n\nschema.index(\n    {exp: 1},\n    {expireAfterSeconds: 0}\n);\nschema.index({foo: 1});\n\nconst model = mongoose.model(\"MyModel\", schema);\n\nconst cache = cacheManager.caching({\n    store: mongooseStore,\n    model: model\n});\n```\n\n## License\n\nMIT No Attribution\n\nhttps://github.com/aws/mit-0\n","maintainers":[{"name":"disjunction","email":"or@pluseq.com"}],"time":{"modified":"2022-06-13T05:23:20.940Z","created":"2016-04-17T08:53:35.426Z","0.0.1":"2016-04-17T08:53:35.426Z","0.0.2":"2016-10-15T10:35:07.279Z","0.0.3":"2016-12-01T21:09:12.612Z","0.0.4":"2016-12-21T20:30:10.476Z","0.1.0":"2021-09-30T19:33:07.032Z","0.2.0":"2021-10-23T08:37:16.908Z","1.0.0":"2021-10-23T10:12:14.808Z","1.0.1":"2022-05-14T05:54:51.670Z"},"homepage":"https://github.com/disjunction/node-cache-manager-mongoose#readme","keywords":["cache","mongoose","cache manager"],"repository":{"type":"git","url":"git+https://github.com/disjunction/node-cache-manager-mongoose.git"},"author":{"name":"Konstantin Pogorelov","email":"or@pluseq.com"},"bugs":{"url":"https://github.com/disjunction/node-cache-manager-mongoose/issues"},"license":"MIT-0","readmeFilename":"README.md"}