1.0.1 • Published 6 years ago
build-db-index v1.0.1
what to handle
build mongodb indexes by config file
how to use
npm install build-db-index
async function build() {
await setIndex({uri:"mongodb://127.0.0.1:27017",db:"test"},
{
offer:[
{key:{offer_id:1,time:1}},
{key:{ttl:1},options:{expireAfterSeconds:2600}}
],
user:[{key:{userid:1},options:{unique:true}}]
})
}
build().catch(console.error);