Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
Sicherheitslücken (CVE)IT Security News Hourly Summary 2026-09-29 11h : 7 posts(29.09.2026 um 11:00 Uhr)
•
IT Security NachrichtenSeptember 2026 Cyber Attacks Timeline(29.09.2026 um 11:01 Uhr)
•••
IT Security NachrichtenCloudflare’s EmDash 1.0 makes sandboxed plugins ask for access first(29.09.2026 um 11:03 Uhr)
•
IT Security NachrichtenEngineering velocity is a competitive advantage in modern cybersecurity(29.09.2026 um 11:00 Uhr)
•
Sicherheitslücken (CVE)Kiteworks patches critical flaw, brings customer systems online(29.09.2026 um 11:04 Uhr)
•
IT Security NachrichtenGroßrazzia gegen Mogel-Handy-Ring: 300 Millionen Euro Schaden(29.09.2026 um 11:14 Uhr)
•
Malware / Trojaner / VirenMalware-Schutz auf QNAP-NAS richtig steuern(29.09.2026 um 11:00 Uhr)
••
Sicherheitslücken (CVE)IT Security News Hourly Summary 2026-09-29 11h : 7 posts(29.09.2026 um 11:00 Uhr)
•
IT Security NachrichtenSeptember 2026 Cyber Attacks Timeline(29.09.2026 um 11:01 Uhr)
•••
IT Security NachrichtenCloudflare’s EmDash 1.0 makes sandboxed plugins ask for access first(29.09.2026 um 11:03 Uhr)
•
IT Security NachrichtenEngineering velocity is a competitive advantage in modern cybersecurity(29.09.2026 um 11:00 Uhr)
•
Sicherheitslücken (CVE)Kiteworks patches critical flaw, brings customer systems online(29.09.2026 um 11:04 Uhr)
•
IT Security NachrichtenGroßrazzia gegen Mogel-Handy-Ring: 300 Millionen Euro Schaden(29.09.2026 um 11:14 Uhr)
•
Malware / Trojaner / VirenMalware-Schutz auf QNAP-NAS richtig steuern(29.09.2026 um 11:00 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

MongoDB - Essential Things to Know

MongoDB is a non-relational database (NoSQL), known for its flexibility and scalability. This article will focus on understanding key concepts like documents, collections, querying, schema modeling, and even more advanced features such as…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

MongoDB is a non-relational database (NoSQL), known for its flexibility and scalability. This article will focus on understanding key concepts like documents, collections, querying, schema modeling, and even more advanced features such as GridFS and server administration.






Concept Highlights:




  1. Documents and Collections

  2. Querying

  3. Data and Schema Modeling

  4. How to Use GridFS to Store Files

  5. Server Administration






1. Documents and Collections



In MongoDB, documents are individual records stored in collections, which are analogous to tables in a relational database. Each document is a JSON-like structure.





  • Querying documents with .find(): the .find() method allows you to query the documents within a collection.




db.users.find({ name: 'Freddie Freeman' });








  • Collections are containers for documents. You can view all collections in a database by using:




show collections;







  • To list all available databases:




show dbs;









2. Querying



MongoDB offers a powerful querying system that allows you to refine your data using sort, limit, and skip.





  • Sorting your results:




db.users.find().sort({ age: 13 }); // ascending order by age








  • Limiting the number of results:




db.users.find().limit(5);  // return the first 5 documents








  • Skipping results:




db.users.find().skip(10); // skip the first 10 documents









MongoDB Shell & mongosh:




  • mongosh is the new MongoDB shell, which provides an enhanced experience for querying and database interaction.


  • To format your query results nicely:





db.users.find().pretty();









3. Data and Schema Modeling



One of the advantages of MongoDB is its flexibility with schema design, but structuring your data efficiently is crucial for performance and scalability.




  • Documents in MongoDB do not require a predefined schema, unlike relational databases.



  • Schema design revolves around the nature of your queries:





    • Embedded documents: Useful for nested data that is retrieved together.


    • References: Use when you need to maintain relationships between documents (similar to foreign keys).








Modeling data correctly will have a big impact on performance when working with large datasets.






4. How to Use GridFS to Store Files



GridFS is a powerful features of MongoDB that enables you to store and retrieve large files such as images, videos, backups (exceeding the BSON-document size limit of 16MB) by splitting them into chunks.




  • Storing files in GridFS:




mongofiles -d mydb put myfile.txt







  • Retrieving files:




mongofiles -d mydb get myfile.txt









5. Server Administration




  • MongoDB Config File:

    MongoDB can configured through its config file, usually located at /etc/mongod.conf. This file contains all essential settings, like the port number, storage path, and authentication settings.



  • Replication:

    Replication allows you to create copies of your MongoDB data across multiple servers, ensuring high availability and redundancy.




    • You can set up a replica set, which is a group of MongoDB instances that maintain the same data set.






  • Sharding:


    Sharding is a method for distributing data across multiple servers. MongoDB uses sharding to handle very large datasets by splitting them into smaller, more manageable pieces known as shards.





  • Authentication and Authorization:

    MongoDB supports built-in authentication and authorization mechanisms. You can control access to your databases by creating users with specific roles, granting them permissions as needed.




    • To create a new user with read-only permissions:









db.createUser({
user: 'readonly',
pwd: 'password',
roles: [{ role: 'read', db: 'mydb' }]
});








  • Backups:

    Backing up your MongoDB data is crucial for data integrity. There are several ways to backup MongoDB data:





    • mongodump: Exports the data into BSON format.









mongodump --db mydb --out /backup/location








  • mongorestore: Restores the backup created by mongodump.




mongorestore --db mydb /backup/location


Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten MongoDB - Essential Things to Know

Thematisch verwandte Begriffe: MongoDB, Essential, Things, Know · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-102240 | A vulnerability was found in Netcore NAP930 0.1.241010.141410. This aff…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag