Mongodb helper(s).
- node: 22
- mongodb: ^7.5.0
Through NPM as @chubbyts/chubbyts-mongodb.
npm i @chubbyts/chubbyts-mongodb@^2.3.0const mongoClient = await MongoClient.connect('mongodb://localhost');
await upsertIndexes(mongoClient, {
pet: [
{
key: { id: 1 },
name: 'pet.id',
unique: true,
},
{
key: { name: 1 },
name: 'pet.name',
},
]
});2026 Dominik Zogg