MongoDB logo
  • Platform
    atlas_product_familyAtlasBuild on a developer data platform
    Platform Services
    atlas_databaseDatabaseDeploy a multi-cloud databaseatlas_searchSearchDeliver engaging search experiencesmdb_vector_searchVector SearchDesign intelligent apps with gen AIatlas_stream_processingStream ProcessingUnify data in motion and data at rest
    Self Managed
    enterprise_advanced_product familyEnterprise AdvancedRun and manage MongoDB yourselfcommunity_edition_product_familyCommunity EditionDevelop locally with MongoDB
    Tools
    mdb_compassCompassWork with MongoDB data in a GUIatlas_integrationIntegrationsIntegrations with third-party servicesmdb_migratorRelational MigratorMigrate to MongoDB with confidence
    View All ProductsExplore our full developer suitearrow-right
    Build with MongoDB Atlas
    Get started for free in minutes
    Sign Up
    Test Enterprise Advanced
    Develop with MongoDB on-premises
    Download
    Try Community Edition
    Explore the latest version of MongoDB
    Download
  • Documentation
    Atlas DocumentationGet started using AtlasServer DocumentationLearn to use MongoDBStart With GuidesGet step-by-step guidance for key tasks
    Tools and ConnectorsLearn how to connect to MongoDBMongoDB DriversUse drivers and libraries for MongoDB
    Resources HubGet help building the next big thing with MongoDBarrow-right
    Connect
    atlas_product_familyDeveloper CenterExplore a wide range of developer resourcesgeneral_events_ask_the_expertsCommunityJoin a global community of developersgeneral_content_tutorialCourses and CertificationLearn for free from MongoDBgeneral_events_sessionEvents and WebinarsFind an event or webinar near you
  • Use cases
    Artificial IntelligenceEdge ComputingInternet of ThingsMobilePaymentsServerless Development
    Industries
    Financial ServicesTelecommunicationsHealthcareRetailPublic SectorManufacturing
    Solutions LibraryOrganized and tailored solutions to kick-start projectsarrow-right
    Developer Data Platform
    Accelerate innovation at scale
    Learn morearrow-right
    Startups and AI Innovators
    For world-changing ideas and AI pioneers
    Learn morearrow-right
    Customer Case Studies
    Hear directly from our users
    See Storiesarrow-right
  • CareersStart your next adventureBlogRead articles and announcementsNewsroomRead press releases and news stories
    PartnersLearn about our partner ecosystemLeadershipMeet our executive teamCompanyLearn more about who we are
    Contact Us
    Reach out to MongoDB
    Let’s chatarrow-right
    Investors
    Visit our investor portal
    Learn morearrow-right
  • Pricing
SupportSign InTry Free
MongoDB logo
MongoDB logo
  • Platform
    atlas_product_familyAtlasBuild on a developer data platform
    Platform Services
    atlas_databaseDatabaseDeploy a multi-cloud databaseatlas_searchSearchDeliver engaging search experiencesmdb_vector_searchVector SearchDesign intelligent apps with gen AIatlas_stream_processingStream ProcessingUnify data in motion and data at rest
    Self Managed
    enterprise_advanced_product familyEnterprise AdvancedRun and manage MongoDB yourselfcommunity_edition_product_familyCommunity EditionDevelop locally with MongoDB
    Tools
    mdb_compassCompassWork with MongoDB data in a GUIatlas_integrationIntegrationsIntegrations with third-party servicesmdb_migratorRelational MigratorMigrate to MongoDB with confidence
    View All ProductsExplore our full developer suitearrow-right
    Build with MongoDB Atlas
    Get started for free in minutes
    Sign Up
    Test Enterprise Advanced
    Develop with MongoDB on-premises
    Download
    Try Community Edition
    Explore the latest version of MongoDB
    Download
  • Documentation
    Atlas DocumentationGet started using AtlasServer DocumentationLearn to use MongoDBStart With GuidesGet step-by-step guidance for key tasks
    Tools and ConnectorsLearn how to connect to MongoDBMongoDB DriversUse drivers and libraries for MongoDB
    Resources HubGet help building the next big thing with MongoDBarrow-right
    Connect
    atlas_product_familyDeveloper CenterExplore a wide range of developer resourcesgeneral_events_ask_the_expertsCommunityJoin a global community of developersgeneral_content_tutorialCourses and CertificationLearn for free from MongoDBgeneral_events_sessionEvents and WebinarsFind an event or webinar near you
  • Use cases
    Artificial IntelligenceEdge ComputingInternet of ThingsMobilePaymentsServerless Development
    Industries
    Financial ServicesTelecommunicationsHealthcareRetailPublic SectorManufacturing
    Solutions LibraryOrganized and tailored solutions to kick-start projectsarrow-right
    Developer Data Platform
    Accelerate innovation at scale
    Learn morearrow-right
    Startups and AI Innovators
    For world-changing ideas and AI pioneers
    Learn morearrow-right
    Customer Case Studies
    Hear directly from our users
    See Storiesarrow-right
  • CareersStart your next adventureBlogRead articles and announcementsNewsroomRead press releases and news stories
    PartnersLearn about our partner ecosystemLeadershipMeet our executive teamCompanyLearn more about who we are
    Contact Us
    Reach out to MongoDB
    Let’s chatarrow-right
    Investors
    Visit our investor portal
    Learn morearrow-right
  • Pricing
SupportSign InTry Free
MongoDB logo
  • Docs Home

  • Go Driver
  • Quick Start
  • Quick Reference
  • What's New
  • Usage Examples
  • Fundamentals
  • Connections
  • Stable API
  • Context
  • Authentication Mechanisms
  • Enterprise Authentication Mechanisms
  • Work with BSON
  • CRUD Operations
  • Read Operations
  • Write Operations
  • Insert a Document
  • Delete Documents
  • Modify Documents
  • Update Arrays in a Document
  • Insert or Update in a Single Operation
  • Bulk Operations
  • Compound Operations
  • Modify Execution of CRUD Operations
  • Aggregation
  • Indexes
  • Transactions
  • Logging
  • Run a Command
  • Collations
  • Monitoring
  • GridFS
  • Time Series Collections
  • In-Use Encryption
  • Work with Geospatial Data
  • API Documentation
  • FAQ
  • Connection Troubleshooting
  • Issues & Help
  • Compatibility
  • View the Source
    Docs Menu
    Docs Home
    /
    Languages
    /
    Go
    /
    Go Driver
    /
    Fundamentals
    /
    CRUD Operations

    Write Operations

    • Insert a Document

    • Delete Documents

    • Modify Documents

    • Update Arrays in a Document

    • Insert or Update in a Single Operation

    • Bulk Operations

    Back

    Monitor Data Changes

    Next

    Insert a Document