type MongoDBSchemas = {
'db.books': Book;
'db.authors': Author;
}
const model: ClientBulkWriteModel<MongoDBSchemas> = {
namespace: 'db.books'
name: 'insertOne',
document: { title: 'Practical MongoDB Aggregations', authorName: 3 } // error `authorName` cannot be number
};
The type of the namespace
field narrows other parts of the BulkWriteModel to use the correct schema for type assertions.
A mapping of namespace strings to collections schemas.