Turuq Onboarding

Database & Storage

This section outlines how we interact with our primary database MongoDB and cloud storage Supabase Storage for managing data and files within our applications.

MongoDB

MongoDB is a NoSQL database that stores data in flexible, JSON-like documents. It is the primary database for all our applications. We use the Mongoose to interact with the database. Read more about MongoDB

Mongoose

Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.js. It manages relationships between data, provides schema validation, and is used to translate between objects in code and the representation of those objects in MongoDB. Read more about Mongoose

Schemas & Models

  1. Schemas: Schemas are the structure of the document that is stored in the database. It defines the shape of the documents within a collection.
  2. Models: Models are constructors that take a schema and create an instance of a document that can be saved and retrieved from the database.

Read more about Schemas Read more about Models

Middleware

Middleware is a function that runs before or after a specific operation. It is used to perform operations like validation, encryption, etc. You can find more about middleware here

Aggregation

Aggregations are operations that process data records and return computed results. Aggregations can be used to group documents, filter them, and perform complex operations on them. Mongoose provides a way to perform aggregation using the aggregate method. You can find more about aggregation here

Bulk Operators

Bulk operations are used to perform multiple operations at once. Mongoose provides a way to perform bulk operations using the bulkWrite method. You can find more about bulk operations here

Supabase Storage

Supabase is an open-source Firebase alternative. It provides a set of tools to build applications with features like authentication, real-time data, and file storage. We use Supabase Storage to store files like images, videos, and other media files. Read more about Supabase Storage

On this page