28

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?

Community
  • 1
  • 1
Alon Ashkenazi
  • 1,223
  • 4
  • 21
  • 29

1 Answers1

31

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.

Ben McCann
  • 18,548
  • 25
  • 83
  • 101
Dmitry Reznik
  • 6,812
  • 2
  • 32
  • 27
  • RAM drive is something I'd use for time being too, nowadays setting up one is really easy independent of your OS. – Esko Apr 04 '12 at 06:28
  • does it mean that RAM mode works for mongodb now? – alvas Sep 18 '14 at 19:54
  • check this link out: http://edgystuff.tumblr.com/post/49304254688/how-to-use-mongodb-as-a-pure-in-memory-db-redis – Anand Rockzz Mar 29 '15 at 15:55
  • 5
    You can run MongoDB 3 with in memory storageEngine: mongod --dbpath path_to_folder --storageEngine=inMemoryExperiment – Gerardo Hernandez Jul 13 '15 at 16:57
  • 1
    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 Dec 28 '15 at 20:05