Using CRUD Operations in MongoDB in Node.js Using Mongoose

MongoDB CRUD Operations

Mongoose provides a simple schema-based solution to model your app data. In this post, we will see how we can use it to write basic CRUD operations in Node.js.

Understanding Schema

First let's write a Mongoose schema for a sample requirement. Example entity is Team, where I want to save:

Implement a Command-Line Shell by Using Command Dispatcher in Python

Let's implement a command Shell by using a command dispatcher. The objective is to have an event loop, which is to dispatch input commands and implement some handlers who are going to handle those commands. And, we don't want to change in the event loop whenever some new command comes in future. So, our design should be scalable enough to support adding new commands without affecting the event loop.

Decorator in Python

I hope you have seen Timeit implementation using Decorator.