Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Error’d: Pickup Sticklers

      September 27, 2025

      From Prompt To Partner: Designing Your Custom AI Assistant

      September 27, 2025

      Microsoft unveils reimagined Marketplace for cloud solutions, AI apps, and more

      September 27, 2025

      Design Dialects: Breaking the Rules, Not the System

      September 27, 2025

      Building personal apps with open source and AI

      September 12, 2025

      What Can We Actually Do With corner-shape?

      September 12, 2025

      Craft, Clarity, and Care: The Story and Work of Mengchu Yao

      September 12, 2025

      Cailabs secures €57M to accelerate growth and industrial scale-up

      September 12, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Using phpinfo() to Debug Common and Not-so-Common PHP Errors and Warnings

      September 28, 2025
      Recent

      Using phpinfo() to Debug Common and Not-so-Common PHP Errors and Warnings

      September 28, 2025

      Mastering PHP File Uploads: A Guide to php.ini Settings and Code Examples

      September 28, 2025

      The first browser with JavaScript landed 30 years ago

      September 27, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured
      Recent
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»MongoDB Create Datbases and Collections

    MongoDB Create Datbases and Collections

    August 21, 2025

    MongoDB stores data in a Database → Collection → Document structure.

    Database → Like a container for collections (similar to a database in SQL).

    Collection → Like a table in SQL, it contains multiple documents.

    Document → A JSON-like object that stores actual data.

    Create a Database

    Create a Database

    use database_name

    If myDatabase doesn’t exist, it will create a new database.

    For checking the current database:

    db

    To show all databases:

    show dbs
    MongoDb Datbase Creation

    Create a Collection

    db.createCollection("collection_name") // syntax
    
    db.createCollection("students")

    This will create an empty collection named students.

    To view collections in the current DB:

    show collections

    The post MongoDB Create Datbases and Collections appeared first on PHPGurukul.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleLower Cloud Bills, Faster MTTR, Stronger Security: One Platform for Node.js
    Next Article Headless CMS: The Future of Websites

    Related Posts

    Development

    Using phpinfo() to Debug Common and Not-so-Common PHP Errors and Warnings

    September 28, 2025
    Development

    Mastering PHP File Uploads: A Guide to php.ini Settings and Code Examples

    September 28, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Cloudsmith launches ML Model Registry to provide a single source of truth for AI models and datasets

    Tech & Work

    From GenAI Demos to Production: Why Structured Workflows Are Essential

    Machine Learning
    Build an enterprise synthetic data strategy using Amazon Bedrock

    Build an enterprise synthetic data strategy using Amazon Bedrock

    Machine Learning

    20+ Best Free Slideshow & Gallery Templates for After Effects in 2025

    Learning Resources

    Highlights

    Disney is winding down the Hulu app – here’s what subscribers need to know

    August 6, 2025

    Disney also plans to launch a new standalone sports streaming service that’s available without a…

    The Wild West of Shadow IT

    August 4, 2025

    Training LLM Agents Just Got More Stable: Researchers Introduce StarPO-S and RAGEN to Tackle Multi-Turn Reasoning and Collapse in Reinforcement Learning

    May 2, 2025

    Laravel’s Enhanced String Validation with Inverse Methods

    August 27, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.