Aggregation Framework Operators
Pipeline Operators :- NOTE The aggregation pipeline cannot operate on values of the following types: Symbol, MinKey, MaxKey,DBRef, Code, and CodeWScope. Pipeline operators appear in an array. Documents pass through the operators in a sequence. Name Description $project Reshapes a…
MongoDB High Availability Min configuration
If you have 1 Primary node, 1 Secondary node and 1 Arbiter, and you are using majority write, then you are requiring that the write be made on both the Primary and the Secondary. As soon as one of those…
MongoDB Aggregation Concepts
MongoDB provides the three approaches to aggregation, each with its own strengths and purposes for a given situation. This section describes these approaches and also describes behaviors and limitations specific to each approach. See also the chart that compares the…
password option file in MongoDB
if you’re curious to know whether we’ve password option file concept in MongoDB something similar to MySQL (refer below links). http://dev.mysql.com/doc/refman/5.1/en/password-security-user.html http://stackoverflow.com/questions/16299603/mysql-utilities-my-cnf-option-file With this, we can actually save credentials in a option hidden file within client session and we no…
NUMA (Non Uniform Memory Access) for MongoDB
We usually did see some performance boost when NUMA was disabled using -> numactl –interleave=all ….. Below are the details from MongoDB http://docs.mongodb.org/manual/administration/production-notes/ Running MongoDB on a system with Non-Uniform Access Memory (NUMA) can cause a number of operational problems,…
MongoDB Queries
–> To find documents in a collection we have syntax db.<collection Name>.find(); –> db.books.find(); — it will provide all documents in collection books. It actually returns a cursor. –> To make the output look a bit pretty we have following…
MongoDB Authentication
[root@my-host-name bin]$ cat /etc/mongod.conf # MongoDB Configuration File # # General Settings journal = true fork = true quiet = true directoryperdb = true smallfiles = true # Logging verbose = true logappend = true oplogSize = 50 #logpath =…
MongoDB: Change opLog Size
What is opLog ? Just as Transaction Log in MS SQL Server or Binary log in MySQL, all those transactions on MongoDB RS will be written into a separate file, called opLog. This opLog will have a fixed size, which…
MongoDB Diagnostic Tools/Utilities
MongoDb Inc. currently don’t have one-tool-for-any-troubleshooting-scenario. However, they have a number of tools that help with different aspects of trouble shooting. The best practice is (like in many other Monitoring/Troubleshooting apps) to have a holistic (NOC) view on overall system…
MongoDB Export cmd
Here’s is a simple MongoDB ‘mongoexport’ command syntax to backup the document/database. This command can be used to backup based on particular conditions (‘where’ clause) Go to MongoDB bin directory and execute as below:./mongoexport –host localhost –port 10000 -d doc_name…