–> 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…

Map step: mapper.py It will read data from STDIN, split it into words and output a list of lines mapping words to their (intermediate) counts to STDOUT. The Map script will not compute an (intermediate) sum of a word’s occurrences…

DELETE WITH LIMIT helps when there are duplicate records in the DB and you want to keep only few records from them and wanted to delete the rest of all.       LIMIT with DELETE Query :-   mysql>…

One of the common error in MySQL Replication is ‘Duplicate Entry’ – Error 1062. This pop-ups only if there are any manual intervention. The SQL Thread stops with this error. Just check the record in the error on both master…

[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 =…

How do we copy ‘Yum Repositories’ from one server to another :- Imagine, you have java package not available in your SERVER#1 and you know it is available with SERVER#2. Then you can copy the require yum repositories configs from…

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…

Consider, a MySQL table having values in a column like below: SELECT location  FROM geo LIMIT 3; “location” “India.Karnataka.Shimoga.Gopala” “India.Karnataka.Bengaluru.BTM” “India.Karnataka.Chikmaglore.Koppa” My requirement is to take only 4th value from each of the rows(such as, Gopala,BTM,Koppa). I don’t want to…

Linux: Adding Numbers in a File Here’s a Linux command to add numbers inside a file: [root@myserver misc]# cat num.test 1 2 3 4 5 This is a sample file with only 5 lines. Think of a file with millions…