mongod
and client runs with mongo
.In MongoDB 3.0, MMAP (default) and WiredTiger are the stable storage engines. Usually, if your app is read-heavy, use MMAP. If its write-heavy, use WiredTiger.
Your solution may also have a mixed replica set members where you can have one node configured with MMAP and another with WiredTiger. You can use one to insert massive data and the other to read with analytical tools.
After MongoDB 3.2, WiredTiger becomes the default engine.
Updating and Deleting a document should be done carefully. Since operation may affect for multiple documents.
Aggregation framework in MongoDB is used to achieve common GROUP BY
functionality of SQL.
Consider the following insertions in collection named transactions
for every example.
> db.transactions.insert({ cr_dr : "D", amount : 100, fee : 2});
> db.transactions.insert({ cr_dr : "C", amount : 100, fee : 2});
> db.transactions.insert({ cr_dr : "C", amount : 10, fee : 2});
> db.transactions.insert({ cr_dr : "D", amount : 100, fee : 4});
> db.transactions.insert({ cr_dr : "D", amount : 10, fee : 2});
> db.transactions.insert({ cr_dr : "C", amount : 10, fee : 4});
> db.transactions.insert({ cr_dr : "D", amount : 100, fee : 2});
Performance Impact: Note that indexes improve read performances, but can have bad impact on write performance, as inserting a document requires updating all indexes.
Reference for $set operator: $set on offical website
Constructing a list of write operations to perform in bulk for a single collection.
Create Database
If you have an older version of MongoDB, you must upgrade the whole path to the newest version. For example, if you are running version 3.0 and want to get version 3.4, you must upgrade 3.0->3.2->3.4.