How can we integrate mongoDb and mongoose instead of the prisma .handle sessionStorage.

I have done with the connection of the Mongodb but when I am integrating the custom functions to store the sessions I am not able to do that. Can anyone help me