The problem of multithreading accessing mongodb

in java, mongodb is operated by multiple threads.
uses mongoTemplate as an operation.
then, there are more than five hundred threads to operate on the mongodb.
then, it was found that none of the 500-plus threads had to create a new mongodb connection at the beginning.
I just want to ask that an error is reported if the default number of queues of mongodb is500.
I just want to ask, is it necessary that every thread produces a mongodb connection? Can you "save" the number of connections in mongodb?

Mar.13,2021

sets connection pooling, which is actually the usage scenario of connection pooling.
MongoClient has this feature.
configure the maximum number of connections for the connection pool.

Menu