ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3146Mongo Db
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3146

    Advance Database Management Systems

    Progress0 / 18 done
    Topics18
    1Introduction to advance data models such as object relational, object oriented2File organizations concepts3Transactional processing4Concurrency control techniques5Recovery techniques6Query processing and optimization7Database Programming (PL/SQL)8Database Programming (T-SQL)9Database Programming (similar technology)10Integrity and security11Database Administration (Role management)12Database Administration (managing database access)13Database Administration (views)14Physical database design and tuning15Distributed database systems16Emerging research trends in database systems17MONGO DB18NO SQL (or similar technologies)
    3 min read
    Topic 17 of 18
    Topic Study Note Illustration
    17

    MONGO DB

    Example document:

    šŸƒ MongoDB: Introduction and Key Concepts


    1. What is MongoDB?

    • MongoDB is a NoSQL, document-oriented database.
    • It stores data in JSON-like BSON documents instead of traditional tables and rows.
    • Designed for high performance, scalability, and flexibility.

    2. Key Features of MongoDB

    Feature Description
    Document Model Data stored in flexible, self-describing JSON-like documents.
    Schema-less Documents in a collection can have different structures.
    Indexing Supports various index types (single field, compound, text, geospatial).
    Replication Supports replica sets for high availability and failover.
    Sharding Horizontal scaling by partitioning data across multiple servers.
    Aggregation Framework Powerful tools for data processing and transformation.
    Ad hoc Queries Rich query language supporting filtering, sorting, projection.
    Horizontal Scalability Designed to scale across many servers easily.

    3. Data Model

    • Database contains collections.
    • A collection is a group of documents.
    • A document is a JSON-like structure made of key-value pairs.

    Example document:

    {
      "_id": ObjectId("507f1f77bcf86cd799439011"),
      "name": "John Doe",
      "age": 30,
      "address": {
        "street": "123 Main St",
        "city": "New York"
      },
      "hobbies": ["reading", "gaming"]
    }
    

    4. CRUD Operations in MongoDB

    Operation Example Command
    Create db.users.insertOne({name: "Alice", age: 25})
    Read db.users.find({age: {$gt: 20}})
    Update db.users.updateOne({name: "Alice"}, {$set: {age: 26}})
    Delete db.users.deleteOne({name: "Alice"})

    5. Indexing

    • Indexes improve query speed.

    • Types of indexes:

      • Single field
      • Compound (multiple fields)
      • Text indexes (for text search)
      • Geospatial indexes (for location-based queries)

    Example of creating an index:

    db.users.createIndex({age: 1})
    

    6. Replication and Sharding

    • Replication: Data copies maintained across multiple servers (replica sets) for availability and fault tolerance.
    • Sharding: Splitting data across multiple machines to handle large datasets and high throughput.

    7. Aggregation Framework

    • Allows data processing and transformation.
    • Supports operations like filtering, grouping, sorting, and joining (via $lookup).

    Example:

    db.orders.aggregate([
      { $match: { status: "shipped" } },
      { $group: { _id: "$customerId", total: { $sum: "$amount" } } }
    ])
    

    8. Advantages of MongoDB

    • Flexible schema fits evolving data models.
    • High write performance for big data and real-time apps.
    • Easy to scale out via sharding.
    • Rich query and aggregation capabilities.
    • Strong community and enterprise support.

    9. Use Cases

    • Content management systems
    • Real-time analytics
    • Internet of Things (IoT) applications
    • Mobile and social networking apps
    • Catalog and inventory management

    10. Summary Table

    Aspect Description
    Type NoSQL document database
    Data Model Collections and JSON-like documents
    Query Language Rich query with JSON syntax
    Scalability Horizontal (sharding) and vertical
    Replication Replica sets for fault tolerance
    Schema Schema-less / flexible

    ← Previous topic 16
    Emerging research trends in database systems
    Next topic 18 →
    NO SQL (or similar technologies)

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    428words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Advance Database Management Systems