kaizendorks / pymongo_inmemory

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

Allow use of local mongod #65

Closed kschniedergers closed 1 year ago

kschniedergers commented 1 year ago

First off, wanted to say love the project :)

I'm currently developing on arch linux, meaning the highest possible version for me to use right now is mongod 4.0, however, I have mongod 6.0 running locally, when I just put "mongod" in my command line.

This basically just adds a configuration parameter than when set to true (defaulting to false), runs just "mongod" in the command line instead of downloading it and using that ones location.

ekarademir commented 1 year ago

Hi @kschniedergers Thank you so much for the feedback and the PR and I appreciate your comment on the project! I'll have a look later today.

One downside to this I can imagine is the following.

By default we are spinning up a new MongoDB server with in memory storage. Which means that after we are done, it's gone. In this case there might bee leaked states between tests.

I'll try to test how would that affect the usage though.

Thanks!

ekarademir commented 1 year ago

I'm sorry this took so long. I think this is a very short and elegant solution. I'll merge it and we'll release it later today with version updates.