MongoDB is a NoSQL database that stores data in flexible, JSON-like documents, allowing for dynamic schemas. Unlike relational databases, which use structured tables and fixed schemas, MongoDB can handle unstructured data and scale horizontally, making it more suitable for applications with varying data types and large volumes of data.

MongoDB is a NoSQL database that stores data in flexible, JSON-like documents, allowing for dynamic schemas. Unlike relational databases, which use structured tables and fixed schemas, MongoDB can handle unstructured data and scale horizontally, making it more suitable for applications with varying data types and large volumes of data.
A document in MongoDB is a basic unit of data that is stored in a collection. It is structured as a JSON-like format called BSON (Binary JSON), which consists of key-value pairs. Each document can have different fields and data types, allowing for flexible and dynamic schemas.
Sharding in MongoDB is a method of distributing data across multiple servers or clusters to ensure horizontal scalability. It works by partitioning data into smaller, manageable pieces called shards, each stored on a different server. This allows MongoDB to handle large datasets and high throughput operations by spreading the load and improving performance. Sharding is used to manage large volumes of data and to ensure that the database can grow seamlessly as data needs increase.
MongoDB Atlas is a cloud-based database service provided by MongoDB that simplifies database management by automating tasks such as deployment, scaling, backups, and monitoring. It allows users to easily create, manage, and scale MongoDB databases without the need for extensive infrastructure management.
In MongoDB, schema design involves defining collections and documents based on the application's needs, using a flexible schema to accommodate varying data structures. Key considerations include embedding related data within documents for performance, using references for large or frequently updated data, and ensuring efficient indexing for query performance. It's important to anticipate data access patterns and optimize for read and write operations accordingly.
```sql
CREATE PROCEDURE GetEmployeeByID
@EmployeeID INT
AS
BEGIN
SELECT * FROM Employees
WHERE EmployeeID = @EmployeeID;
END;
```
Content negotiation in REST APIs is the process by which a client and server agree on the format of the response data. This is typically done through HTTP headers, allowing clients to specify their preferred media type (like JSON or XML) and the server to respond accordingly based on the client's request.
API versioning is the practice of managing changes to an API by assigning version numbers to different iterations of the API. It is important in RESTful design because it allows developers to introduce new features or make changes without breaking existing client applications that rely on older versions, ensuring backward compatibility and a smoother transition for users.
PUT replaces the entire resource with the new data provided, while PATCH updates only the specific fields of the resource that are specified.
Some tools used to test RESTful APIs include Postman, Insomnia, SoapUI, JMeter, and Curl.
GET retrieves data from a server.
POST sends data to a server to create a new resource.
PUT updates an existing resource with new data.
PATCH partially updates an existing resource.
DELETE removes a resource from the server.
You can check the status of your Git repository by running the command `git status` in your terminal.
Tags in Git are used to mark specific points in the repository's history, often to denote release versions. To create a tag, use the command `git tag <tag-name>`. To push tags to the remote repository, use `git push origin <tag-name>` or `git push –tags` to push all tags at once.
Git is a version control system that helps manage and track changes in code, while GitHub is a web-based platform that hosts Git repositories and provides collaboration features for developers.
To create and switch to a new branch in Git, use the command:
“`
git checkout -b <branch-name>
“`
To revert a pushed commit, use the command:
“`
git revert <commit-hash>
“`
This creates a new commit that undoes the changes made by the specified commit. After that, push the changes with:
“`
git push
“`