Mongodb helper(s).
- node: 16
- mongodb: ^6.7.0
Through NPM as @chubbyts/chubbyts-mongodb.
npm i @chubbyts/chubbyts-mongodb@^1.4.0
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',
},
]
});
2024 Dominik Zogg