# mongodb/mongo-php-library

The Official MongoDB PHP library

Repository: https://github.com/mongodb/mongo-php-library
Canonical: https://ross.abutalabs.com/products/mongo-php-library
Homepage: https://mongodb.com/docs/php-library/current/
Language: PHP
License: Apache-2.0
License Family: permissive
Topics: php, mongodb, mongodb-driver
Last push: 2026-08-21T11:04:05+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 86, longevity 100
- inputs: {"age_days": 4290, "days_push": 12, "days_rel": 15, "gap_med": 76, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1612, forks 264 (observed 2026-08-28T04:05:11.039807+00:00)

## What it is
The official high-level MongoDB PHP library built on top of the low-level mongodb PHP extension. It provides Client, Database, and Collection abstractions with a full-featured API for CRUD operations, index management, and common database commands.

## Use cases
- connect to mongodb from php
- perform crud operations on mongodb collections in php
- manage mongodb indexes and collections from php
- use mongodb with a php web application
- query mongodb documents with a high-level php api

## When to choose
- you are building a PHP application backed by MongoDB and want a full-featured driver API
- you need client, database, and collection abstractions beyond what the raw mongodb extension offers
- you want an officially supported, actively maintained MongoDB library for PHP

## When to avoid
- your project does not use MongoDB as its database
- you only need the minimal command/query API and want to avoid the extra abstraction layer
- you are not using PHP or cannot install the required mongodb extension

## Facets
- artifact type: library
- maturity: stable
- function: database-driver, database, orm
- domain: databases, backend, web-development
- platform: php, cross-platform
- tags: mongodb, nosql, crud, composer, official-driver, web-server

## Member repositories
- mongodb/mongo-php-library (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:11.039807+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:51:10.517007+00:00, confidence not recorded.
  - readme: https://github.com/mongodb/mongo-php-library (fetched 2026-08-28T04:05:11.039807+00:00, sha 2921b1e7eceb)
  - homepage: https://mongodb.com/docs/php-library/current/ (fetched 2026-08-29T11:23:21.180569+00:00, sha 14d7cd2e9999)
  - site_page: https://www.mongodb.com/docs/atlas (fetched 2026-08-29T11:23:21.191219+00:00, sha f312e042649e)
  - site_page: https://www.mongodb.com/docs/manual (fetched 2026-08-29T11:23:21.192706+00:00, sha 6a4548d2a71b)
  - site_page: https://www.mongodb.com/docs/tools-and-connectors (fetched 2026-08-29T11:23:21.194100+00:00, sha 7c907d21d3d3)
  - site_page: https://www.mongodb.com/docs/drivers (fetched 2026-08-29T11:23:21.195512+00:00, sha 194534c44bc5)
  - site_page: https://www.mongodb.com/docs/atlas/architecture/current/solutions-library (fetched 2026-08-29T11:23:21.197052+00:00, sha 0dfd723aadd5)
  - site_page: https://www.mongodb.com/company/newsroom (fetched 2026-08-29T11:23:21.198462+00:00, sha e3f69e7b7c0c)
  - site_page: https://www.mongodb.com/company/partners (fetched 2026-08-29T11:23:21.200058+00:00, sha 342527daf5e8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
