INNER CODE UNIT · TypeScript
exists
plexinc/papr · src/index.ts:153
const exists = collections.find((item) => item.collectionName === collectionName);
if (exists) {
await this.db.command({
collMod: collectionName,
...options,
});
return;
}
await this.db.createCollection(collectionName, options);
}
/**
* Updates the validation schemas and validation options on all the MongoDB collections registered by models.
*
* @returns {Promise<void>}
*