Using a tmpfs
At least on linux, since MongoDB uses memory mapped (mmap) files, you can set up a tmpfs
system that resides in memory.
Here's a neat tutorial on setting up a tmpfs for MongoDB.
Memory mapped files
Memory mapped files are explained in more detail on their FAQ. It also says that MongoDB is automatically configured to use all available free memory on a system as its cache (link).
Conclusion
Basically, there is no module for a purely in-memory database, but by using an in-memory fs, one can emulate it.
On a side note, I did find MorboDB, a "In-memory database, mostly-compatible clone of MongoDB". Probably not useful to you, but I thought it interesting.