How to store MongoClient in session store

255 Views Asked by At

What is the best way to store client connection? It needs in order to each request didn't request authorization to mongo. When I try:

auto msettings = new MongoClientSettings();
MongoClient client = connectMongoDB(msettings);
req.session.set("client", client);

I get an error in session.d:

static assert: "Type MongoClient contains references, which is not supported for session storage."

0

There are 0 best solutions below