Mongodb helper(s).
npm install @chubbyts/chubbyts-mongodb














Mongodb helper(s).
* node: 18
* [mongodb][2]: ^7.0.0
Through NPM as [@chubbyts/chubbyts-mongodb][1].
``ts`
npm i @chubbyts/chubbyts-mongodb@^2.0.2
`ts``
const mongoClient = await MongoClient.connect('mongodb://localhost');
await upsertIndexes(mongoClient, {
pet: [
{
key: { id: 1 },
name: 'pet.id',
unique: true,
},
{
key: { name: 1 },
name: 'pet.name',
},
]
});
2025 Dominik Zogg
[1]: https://www.npmjs.com/package/@chubbyts/chubbyts-mongodb
[2]: https://www.npmjs.com/package/mongodb