How to use Mongoid with Lambda Execution Context?

Hello, I’m trying to use Mongoid with my Jets application, but I’m facing issues with the Connection Pool.

I have followed the instructions from this post:

But my connections to the database go through the roof.

So, as mentioned in the docs, here:

With ActiveRecord, Jets uses the Lambda Execution Context to have a centralized connection pool to the database.

How can I achieve the same using Mongoid?