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

  • PHP Library Manual
  • Get Started
  • Connect to MongoDB
  • Databases & Collections
  • Read Data
  • Write Data
  • Operations with Builders
  • CRUD Operations & Replica Sets
  • Run a Database Command
  • Data Aggregation
  • Indexes
  • Monitor Your Application
  • Security
  • Specialized Data Formats
  • Deploy to AWS Lambda
  • Compatibility
  • What's New
  • Upgrade
  • FAQ
  • API Documentation
  • BSON
  • MongoDB\Client
  • MongoDB\Database
  • MongoDB\Collection
  • MongoDB\GridFS\Bucket
  • Result Classes
  • BulkWriteResult Class
  • DeleteResult Class
  • InsertManyResult Class
  • InsertOneResult Class
  • UpdateResult Class
  • getMatchedCount()
  • getModifiedCount()
  • getUpsertedCount()
  • getUpsertedId()
  • isAcknowledged()
  • ChangeStream Class
  • MapReduceResult Class
  • CollectionInfo Class
  • CollectionInfoIterator Class
  • DatabaseInfo Class
  • DatabaseInfoIterator Class
  • IndexInfo Class
  • IndexInfoIterator Class
  • Functions
  • Exception Classes
    Docs Menu
    Docs Home
    /
    PHP Library Manual
    /
    API Documentation
    /
    Result Classes

    MongoDB\UpdateResult Class

    Definition

    MongoDB\UpdateResult

    This class contains information about an executed update or replace operation. It encapsulates a MongoDB\Driver\WriteResult object and is returned from MongoDB\Collection::replaceOne(), MongoDB\Collection::updateMany(), or MongoDB\Collection::updateOne().

    Methods

    • MongoDB\UpdateResult::getMatchedCount()

    • MongoDB\UpdateResult::getModifiedCount()

    • MongoDB\UpdateResult::getUpsertedCount()

    • MongoDB\UpdateResult::getUpsertedId()

    • MongoDB\UpdateResult::isAcknowledged()

    Back

    isAcknowledged()

    Next

    getMatchedCount()