I'm new to mongodb and node.js, and confused about connection pooling. Suppose the code is like this:
import mongodb from "mongodb";
const { MongoClient } = mongodb;
const client = new MongoClient("localhost:27017");
async function main() {
await client.connect();
}
According to the driver documentation, MongoClient's has a connection pool of size 5 by default.
So every call await client.connect(); creates 1 connection to mongod, and if I call await client.connect() 6 times, the 6th connection can't be established?