Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use MongoDB as an embedded database?

As the title says I like to embedd the MongoDB server into my own C++ application. I haven't found this mode in the documentation. What I was looking for is something like SQLite or Firebird in the embedded mode. Is this also possible with MongoDB? (Without programming it myself).

like image 209
schoetbi Avatar asked May 05 '11 17:05

schoetbi


People also ask

Can you embed MongoDB?

It's an open source, embeddable document database. While it can function as a standalone document database, its real value is in its ability to synchronize with remote document databases. It may be aimed at iOS / Android, but it can run on anything with a JVM. Save this answer.

Why is MongoDB embedded?

Embedded documents are an efficient and clean way to store related data, especially data that's regularly accessed together. In general, when designing schemas for MongoDB, you should prefer embedding by default, and use references and application-side or database-side joins only when they're worthwhile.

What is embedded collection in MongoDB?

Or in other words, when a collection has a document, this document contains another document, another document contains another sub-document, and so on, then such types of documents are known as embedded/nested documents. Notes – In MongoDB, you can only nest document up to 100 levels.


2 Answers

There is no way to embed MongoDB right now - but on the wishlist of many people.

like image 86
Andreas Jung Avatar answered Oct 20 '22 21:10

Andreas Jung


You should consider EJDB.

EJDB is the C library based on modified version of Tokyo Cabinet. JSON representation of queries and data implemented with API based on C BSON, MongoDB-like queries and overall philosophy.

like image 5
Guy Korland Avatar answered Oct 20 '22 20:10

Guy Korland