Does Mongo DB have an In-Memory mode?

Go To


Possible Duplicate:
Embedded MongoDB when running integration tests

I want to use In-Memory mode for unit test, is there an in In-Memory mode like RavenDB?

2012-04-04 06:01
by Alon Ashkenazi
Didn't you read the official docs - Sergio Tulentsev 2012-04-04 06:02
There is no in-memory mode. See this question for some ideas about testing: - Eve Freeman 2012-04-04 06:11
Yes, there is now: - Irwin 2016-09-23 04:11


There is no in-memory mode for MongoDB. As per this link, this feature won't be included until at least MongoDB 2.8.

Though since it's using Memory-mapped IO, it should be as speedy as in-memory during the actual processing. Not the startup though.

Also, there's a hack to use RAM disk drive and put your mongo db there. That way it would be entirely in memory.

2012-04-04 06:14
by Dmitry Reznik
RAM drive is something I'd use for time being too, nowadays setting up one is really easy independent of your OS - Esko 2012-04-04 06:28
its not a hack - IvanM 2013-09-24 13:46
does it mean that RAM mode works for mongodb now - alvas 2014-09-18 19:54
check this link out: - Anand Rockzz 2015-03-29 15:55
You can run MongoDB 3 with in memory storageEngine: mongod --dbpath pathtofolder --storageEngine=inMemoryExperimen - Gerardo Hernandez 2015-07-13 16:57
another side note related to this, is that folder still has to exist, because it tosses a couple files (eg. mongod.lock) in there - CasualT 2015-12-28 20:05