NoSQL DB Package

Learn how to set up a package with the necessary types and interfaces for interacting with a NoSQL database.

We'll cover the following

Having learned in-depth about how a developer should structure their data entities and interface to communicate with databases efficiently, let’s actually try out building a package for the same in our server. The focus of this package will be on building the right fundamentals to interact with NoSQL databases.

To be able to set it up properly, we will need the following three entities:

  • Config: A type to store connection and configuration details for our database.

  • Query: A type to help build and store a query from scratch.

  • Database: An interface to define the behavior and functionality of our database.

Config

First, let’s write the code for the Config type. We will keep things simple for now and focus only on connection-related parameters.

Get hands-on with 1200+ tech skills courses.