PHPackages                             lalbert/silex-mongodb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. lalbert/silex-mongodb

ActiveLibrary[Database &amp; ORM](/categories/database)

lalbert/silex-mongodb
=====================

Simple mongodb service provider for Silex 2.x and official mongodb driver

v1.0.0(9y ago)52.1k2MITPHP

Since May 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lalbert/silex-mongodb)[ Packagist](https://packagist.org/packages/lalbert/silex-mongodb)[ Docs](https://github.com/lalbert/silex-mongodb)[ RSS](/packages/lalbert-silex-mongodb/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

silex-mongodb
=============

[](#silex-mongodb)

Simple mongodb service provider for Silex 2.x and official mongodb driver

Features
--------

[](#features)

This library provides easy access to a MongoDB database using the extension ([mongodb](http://php.net/manual/en/set.mongodb.php), **not [mongo](http://php.net/manual/en/book.mongo.php)**) and the official [MongoDB PHP driver](https://github.com/mongodb/mongo-php-library).

Requirements
------------

[](#requirements)

- PHP 5.4+
- [mongodb official PECL extension](https://secure.php.net/mongodb)

Installation
------------

[](#installation)

The best way to install the component is using [Composer](https://getcomposer.org/)

```
$ composer require lalbert/silex-mongodb

```

Usage
-----

[](#usage)

### Register service

[](#register-service)

```
$app->register(new MongoDBServiceProvider());

```

You can also pass configuration settings :

*See  for options allowed.*

```
$app->register(new MongoDBServiceProvider(), [
    'mongodb.config' => [
        'server' => 'mongodb://localhost:27017',
        'options' => [],
        'driverOptions' => [],
    ]
]);

```

Your application :

```
$document = ['key' => 'value'];

$app['mongodb']
  ->mydatabase
  ->mycollection
  ->insert($document)
;

```

*See official [MongoDB PHP Library documentation](http://mongodb.github.io/mongo-php-library/)*

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2b541025e615645a30a7f5c3881fb472db732aaa7f1de43ba16cde66aecf03c?d=identicon)[lalbert](/maintainers/lalbert)

---

Top Contributors

[![lucalbert](https://avatars.githubusercontent.com/u/6500267?v=4)](https://github.com/lucalbert "lucalbert (10 commits)")

---

Tags

mongodbsilex-mongodbsilex-providersilex2providermongodbsilex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lalbert-silex-mongodb/health.svg)

```
[![Health](https://phpackages.com/badges/lalbert-silex-mongodb/health.svg)](https://phpackages.com/packages/lalbert-silex-mongodb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[moriony/silex-mongo-provider

Mongo service provider for the Silex framwork.

118.5k](/packages/moriony-silex-mongo-provider)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
