Mongodb helper(s).
- node: 18
- mongodb: ^6.12.0
Through NPM as @chubbyts/chubbyts-mongodb.
npm i @chubbyts/chubbyts-mongodb@^1.5.1
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