I’ve worked on a high-volume site that processed thousands of telecom network subscribers everyday. Me and the rest of the team managed to handle the challenges using MySQl and query optimizations, but now, I wonder how easier the tasks would have been if we had used NoSQL / MongoDB back then.
My environment and methods:
As I wrote this tutorial, I was using Windows 7. I will be using MongoDB Shell edition on my Git Bash.
I actually haven’t used MongoDB yet, but I’m trying to learn it now. Let me share with you the steps I’ve been taking.
MongoDB: Beginner’s guide
For the MongoDB terms such as document, collection, shards, query routes, All out beginner’s guide to MongoDB from Analytics Vidhya provides good explanation.
Download for Windows 7
Download the latest version of signed .msi file from MongoDB Win-32 downloads page. As of writing this was the version I downloaded.
Getting Started with MongoDB (MongoDB Shell Edition)
Let’s follow the instructions from the MongoDB website on getting started with MongoDB using Shell.
You may choose other editions such as Java, Python, Node.JS, and others in this page.
Common hiccups
MongoDB error: SyntaxError: missing ; before statement @(shell)
While running the mongoimport
command, if you get this kind of error in your shell for MongoDB:
Try to open a new command prompt / Git Bash window (or whatever you’re using), navigate to the directory where your mongo.exe is (e.g. C:/MongoDB/bin/) and run your mongoimport
command there.
MongoDB Improper shutdown
When I press Ctrl + C it leads to “improper shutdown” error. Refer to this doc to repair / recover from improper shutdown of MongoDB.