Some Mongo Fun

I’ve been doing “MongoDB for Node.js Developers” course from mongodb university and I’ve really enjoyed it. 5 weeks are over and hopefully the last week is not too bad. There are also courses for Java and Python developers that I plan to enroll for in future. I’m already very comfortable with the mongo shell and the other two courses shouldn’t be too bad, especially as I’ve been using Java on and off for a long time and Python is a fairly simple language.

Covered so far :

-Introduction

– CRUD

-Schema Design

-Performance

-Aggregation

 

Some of the more interesting things I see compared to relational databases:

– Documents are in JSON and in mongo shell the syntax is javascript.

– Need to think of document as well as code in javascrip objects.

-Aggregation is an interesting concept in mongodb – it’s like pipe in unix – you can sequence steps e.g. restrict based on certain criteria , then group on something else followed by sorting.

I didn’t use any IDE for this course – mostly vi and later on Sublime text editor. I see that Robomango is an IDE that can be used but I didn’t use it yet.

Also, instead of typing in the shell, the code can be written in a javascript file. The only requirement is that if you’re using a database other than default – ‘test’, make sure to switch it to the database.

use blog;
db.posts.aggregate(…..

 

I’ve put week5 examples at the below link :

https://github.com/viksingh/mongodBAndNodeMisc/blob/master/week5



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s