Question

I am new to MongoDB and right now I am working on migrating an application from RavenDB to MongoDB. The application uses some of the RavenDBs features and I was able to replicate most of those features in MongoDB except few. Could you please advice me whether following things are achievable in MongoDB or not?

  1. The unit test cases for our application uses the Embedded mode of RavenDB for database tests, Is it possible to run MongoDB in the Embedded or In-memory mode? If it is not possible what are the best practices for writing database test cases for MongoDB? (Mocking wont be a good option in my case.)

  2. RavenDB has native support of versioning of documents, does MongoDB has one?

  3. Does the MongoDB support any class similar to RavenQueryStatistics?

Was it helpful?

Solution

The answers unfortunately are no, no and no.

  1. MongoDB does not support an embedded mode. You should either mock it, or install it on your test environment. Is it possible to use MongoDB as an embedded database?
  2. Versioning doesn't come right out of the box. If you want it you need to implement it. Ways to implement data versioning in MongoDB
  3. MongoDB doesn't really support statistics through the driver. You need to go through the shell to do that.

RavenDB is written in .net which makes it extremely easy to use in a .net environment. MongoDB will be less comfortable, but it will probably perform better (depends on your needs).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top