kaizendorks / pymongo_inmemory

A mongo mocking library with an ephemeral MongoDB running in memory.
MIT License
39 stars 13 forks source link

Make storage engine configurable #100

Closed david-molnar-oculai closed 5 months ago

david-molnar-oculai commented 6 months ago

In mongodb v7 the ephemeral storage engine is not supported anymore. I made it configurable, so it can be disabled.

ekarademir commented 6 months ago

Thank you for the PR @david-molnar-oculai ! Only comment I can make is, since we are basically opening up the possibility of writing data on disk, what are the possible ramifications? I guess, since data folder is configurable, it only makes sense to make this configurable?

When I first started this project, it was heavily influenced by the mockgo library in the JS world. I think ephemeralForTest is coming from that. Also it has been listed in the help text for the mongod. But I couldn't find any reference of it in the docs, going back to 3.2. I guess it was just for their internal testing.

Then maybe the fallback option should be inMemory rather than ephemeralForTest?

ekarademir commented 5 months ago

Thank you for all the good work @david-molnar-oculai I think this is good to merge as is. By fallback, I meant default value for the option we are adding with this PR. But thank you for testing the inMemory availability.

ekarademir commented 4 months ago

This is now published. Thank you for the contribution @david-molnar-oculai