More MongoDB for JavaScript Developers

365 Days of code: Week 7

The mflix web app

This week I left almost every other thing and deeply focused only on the certification course M220JS from MongoDB University. Continuing from the previous post, I will be documenting the changes I make to the mflix-js project as part of the assessment for the certification.

This week, as they call it, is the dynamite week. A lot of important concepts will be introduced that will form the foundation for the final week’s work.

Challenges

The quizzes and exams are supposed to be simple. However, I do need to grapple with a lot of new concepts. Also, JS is very different from Java in which I have coded the most till now.

Certain concepts will appear very esoteric to a Java or C programmer, for instance callbacks, promises, async/await etc. Java appears more like a corporate executive in a suit. On the other hand, JS is the hoodie-wearing hipster who drives a Tesla. It’s kind of a culture shock.

New tool

I also made a change to my toolkit today. Started using VSCode instead of Atom. Atom was a good experience and got my hands dirty with the command line. The syntax highlighting of Atom is good too. But VSCode is the most recommended freely available node.JS IDE. I wanted to checkout why.

Atom

The advantage of VSCode is mainly debugging tools and built-in terminal access and to a lesser degree IntelliSense code completion. This saves the time in changing directories after starting terminal. The biggest advantage, however, is not having to use console.log() and manually debug. The tool will show the variable states to you, similar to Eclipse or IntelliJ IDEA.

IntelliSense

I would recommend anyone trying to learn well to start with the command line and a simple text editor like Atom or SublimeText. This will help to grok the basics really well, before moving to more advanced concepts.

VSCode debug mode
VSCode debug mode

After getting used to the syntax and command line for testing and launching, you can move to an automated tool like VSCode for efficiency reasons. Overall, I’m liking VSCode and I think Microsoft has built a state of the art tool for the node.JS community.

Updated code

I have updated line 263 to to implement the paging requirement:

const displayCursor = cursor.limit(moviesPerPage).skip(moviesPerPage * page)

Testing and execution

GitHub repository

Leave Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll Up