Meetup Recap: Fullstack JS (MongoDB)

Last night I attended the Fullstack JS meetup, which is hosted by/at Zeeto Media. Zeeto looks like such a fun place to work; I frequently check their job board for a chance to apply as a junior dev. It's located in the heart of downtown San Diego, and its office has some pretty views of the city. Although this meetup is downtown, they have reserved free parking in the lot adjacent to the building which is always convenient. Come a bit early and you'll be able to mingle with snacks and drinks too; there are about 40 attendees. I was happy to meet new people, but also see some I knew from other meetup groups too! This community doesn't feel so intimidating anymore! Normally this meetup occurs once every month and consists of different talks on various JS subjects, however lately the focus has been on the MERN stack: MongoDB, Express, React, and Node. We will be covering this stack over the next few months and I think we're even building an app together, so be prepared to learn! The previous meetup was an overview of MERN (which I missed), and last night's meetup was specifically an introduction to MongoDB. 

To be honest, I was torn between attending this meetup and the Ember101 workshop. I have little knowledge about both subjects, and unfortunately they occurred at the same time. But I'm happy with this decision because I learned so much! Michael Roberts Jr did a great job explaining MongoDB with live code and examples. Per usual, I will briefly list some of my notes below: 

  • MondoDB is a noSQL database, which means it doesn't use SQL as its primary language to query the db or do CRUD operations.
  • It leads itself to rapid prototyping and good user experience for getting data quickly.
  • It's safe to use for production only in certain cases, as it favors performance over transaction/accuracy. For example, it's not ideal if you need to keep record of something super important, like banking info, as it may occasionally lose records. 
  • It's document-based, instead of relational tables, which is favorable because they are stored in the way you'd like to consume it. But this puts more of a burden on you because you have to make sure you are maintaining relationships. It is not going to enforce a schema on its own. 
  • Based on the examples given, it seems relatively easy to understand/pick up. Dare I say easier than SQL?
  • Its primary core language is javascript. Its queries/commands look like js. The commands are intuitive and the data is stored and returned in json format. In particular, the data comes back as a block of json which can be hard to read. But there is a "pretty" command that puts the json in a listed view, like we are more familiar with.
  • It's easy to set up. You can download or use brew install it, leave it running in the terminal, then open another terminal and run the command "mongo" to connect to the local host. It'll then enter into a shell that you can use as a REPL. 
  • There are also GUI interfaces, such as robomongo. It's helpful to use robomongo to learn the commands and see exactly what they do visually, before attempting to do so in the terminal.
  • You can use mongolabs for bootstrapping smaller projects for free. If you want to go live without a lot of traffic, Michael recommended digitalocean

Additionally he gave live examples of filtering and projecting, as well as CRUD commands. In particular, the "create" command interested me because there is no command to create a db or collection in the terminal. Instead, if you give a command to store something in a location that doesn't exist, mongo will know that and implicitly create it for you. To learn more, Michael suggested to forget everything we know about SQL! The night ended with a Q&A session, as well as with introductions of first timers.