DEV Community

Mahathir-ali
Mahathir-ali

Posted on

Backend notes

CRUD Operation .
Answer: CRUD stands for Create, Read, Update, Delete.

Create operation:
Operations to create or insert Adding new documents to a collection is a simple process. Insert actions will construct the collection if it does not presently exist.
To add documents to a collection, MongoDB supports the following methods:
db.collection.insertOne().
db.collection.insertMany()

Read Operation:
Read operations are used to retrieve documents from a collection, or to search for documents in a collection. To read documents from a collection, MongoDB supports the following methods:
db.collection.find()

Update Operation:
Update operations are used to make changes to existing documents in a collection. To update documents in a collection, MongoDB supports the following methods:
db.collection.updateOne()
db.collection.updateMany()
db.collection.replaceOne()

Delete Operation:
Delete actions in MongoDB are limited to a single collection. On the level of a single document, all write operations in MongoDB are atomic.
Documents are removed from a collection using delete procedures. To remove documents from a collection, MongoDB supports the following methods:
db.collection.deleteOne()
db.collection.deleteMany()

JWT

JSON Web Token (JWT) is an open standard that specifies a compact and self-contained method for securely communicating information as a JSON object between parties. Because it is digitally signed, this information can be checked and trusted. JWTs can be signed with RSA or ECDSA using a secret or a public/private key combination.Although JWTs can be encrypted to guarantee party-to-party confidentiality, we will concentrate on signed tokens. Signed tokens can be used to validate the validity of the claims they contain, whilst encrypted tokens keep such claims hidden from third parties. When public/private key pairings are used to sign tokens, the signature additionally verifies that only the person with the private key signed it.

Mongoose
Mongoose is a MongoDB and Node.js Object Data Modeling (ODM) module. It handles data associations, does schema validation, and is used to translate between objects in code and their MongoDB representations.

Relational database (MySql)
A relational database uses tables to define database relationships. The tables are connected through data that is shared between them.

Aggregation
Aggregation is the process of combining many things into a single meaningful entity. Because the individual entities do not make sense on their own, they are joined. Aggregation develops a link between various entities in order to form a single entity.

Express
Express js is a Node js framework.The most popular Node web framework is Express, which also serves as the foundation for a number of other prominent Node web frameworks. It has procedures in place to:
Create handlers for requests with various HTTP verbs and URL paths (routes).
Integrate with "view" rendering engines to provide replies by populating templates with data.
Set up typical web application settings such as the connection port and the location of templates for displaying the answer.
At each stage in the request handling pipeline, you can add extra request processing "middleware."
Despite the fact that Express is a rather simple framework, developers have written suitable middleware packages to solve practically any web development issue.

MORE Node
Node.js is an open-source and cross-platform JavaScript runtime environment. It is a popular tool for almost any kind of project.Without establishing a new thread for each request, a Node.js program operates in a single process. Node.js' standard library includes a set of asynchronous I/O primitives that prevent JavaScript code from blocking, and libraries in Node.js are often created following non-blocking paradigms, thus blocking behavior is the exception rather than the rule.

What are the differences between sql and nosql databases?
Answer:
SQL

  1. Tables with fixed columns and rows for storing data.
  2. It is used for general purpose.
  3. Rigid in usage
  4. Join required

NoSQL

  1. IT is very flexible in storing data. It mainly stores data in JSON documents.
  2. Document: general purpose, Key-value: large amounts of data with simple lookup queries, Wide-column: large amounts of data with predictable query patterns.
  3. It’s flexible to use
  4. Joins not required

Top comments (0)