PHPackages                             xatoo/silex2-mongodb-provider - 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. xatoo/silex2-mongodb-provider

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

xatoo/silex2-mongodb-provider
=============================

MongoDB service provider for the Silex 2 framework.

0.0.1(9y ago)0141MITPHPPHP &gt;=5.6

Since Jun 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Sander-Toonen/silex2-mongodb-provider)[ Packagist](https://packagist.org/packages/xatoo/silex2-mongodb-provider)[ Docs](https://github.com/Sander-Toonen/silex-mongodb-provider)[ RSS](/packages/xatoo-silex2-mongodb-provider/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

Silex 2 MongoDb Provider
========================

[](#silex-2-mongodb-provider)

[![Build Status](https://camo.githubusercontent.com/28c745c1b1193bfbe802c9287022c885cb9574cd84b6757e3fd4761ca29aba94/68747470733a2f2f7472617669732d63692e6f72672f53616e6465722d546f6f6e656e2f73696c6578322d6d6f6e676f64622d70726f76696465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Sander-Toonen/silex2-mongodb-provider)[![Coverage Status](https://camo.githubusercontent.com/a11bd40c4e492babd36dd96ed3e6a3a898b5703522d8657893711a5322b630b0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f53616e6465722d546f6f6e656e2f73696c6578322d6d6f6e676f64622d70726f76696465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Sander-Toonen/silex2-mongodb-provider?branch=master)[![Dependency Status](https://camo.githubusercontent.com/1efb55c6573b34e56f2543a079fb35d6b7a4a1849157f4cd8f688fe0041749ba/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537363431623665303733353430303034356262663962302f62616467652e737667)](https://www.versioneye.com/user/projects/57641b6e0735400045bbf9b0)[![StyleCI](https://camo.githubusercontent.com/7439fe5f8386af6f117241c3417c4b6440dbc032679340bf3a029f111b211aff/68747470733a2f2f7374796c6563692e696f2f7265706f732f36313339333837362f736869656c64)](https://styleci.io/repos/61393876)[![SensioLabsInsight](https://camo.githubusercontent.com/b43996c54e090745431f7f6c0bee5e764673696c7f9532c0eba7bc87429ae668/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31346265326265352d353665372d343537642d396131612d6663626133623061653434352f6d696e692e706e67)](https://insight.sensiolabs.com/projects/14be2be5-56e7-457d-9a1a-fcba3b0ae445)[![Latest Stable Version](https://camo.githubusercontent.com/3a0493c157f4715710709b9832e5bf140ed8190903f2b7a12b81c2a915916f10/68747470733a2f2f706f7365722e707567782e6f72672f7861746f6f2f73696c6578322d6d6f6e676f64622d70726f76696465722f762f737461626c65)](https://packagist.org/packages/xatoo/silex2-mongodb-provider)[![Total Downloads](https://camo.githubusercontent.com/eb38a499a3539e414d76ccf8794704524b99192f5b7c5d95d29235ebaeccf7af/68747470733a2f2f706f7365722e707567782e6f72672f7861746f6f2f73696c6578322d6d6f6e676f64622d70726f76696465722f646f776e6c6f616473)](https://packagist.org/packages/xatoo/silex2-mongodb-provider)[![License](https://camo.githubusercontent.com/80676038fbec6a346e1f28506192acd390b5a2f88d50d6b989574e5f964709ab/68747470733a2f2f706f7365722e707567782e6f72672f7861746f6f2f73696c6578322d6d6f6e676f64622d70726f76696465722f6c6963656e7365)](https://packagist.org/packages/xatoo/silex2-mongodb-provider)

[MongoDB](http://mongodb.org/) service provider for the [Silex 2](http://silex.sensiolabs.org/) framework. Tested with PHP7 and the [MongoDB library](http://mongodb.github.io/mongo-php-library/).

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

[](#requirements)

- PHP 5.6 or PHP 7
- PHP [MongoDB driver](http://php.net/manual/en/set.mongodb.php)
- [MongoDB PHP Library](http://mongodb.github.io/mongo-php-library/)

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

[](#installation)

Add the required entry for this library to your `composer.json`.

```
{
    "require": {
        "xatoo/silex2-mongodb-provider": "*"
    }
}
```

and run `composer install` (or `update`) to download all files.

Usage
-----

[](#usage)

### Service registration

[](#service-registration)

```
$app->register(new MongoDBServiceProvider, [
    'mongodb.configuration' => [
        'default' => [
            'server' => "mongodb://localhost:27017",
            'options' => ["connect" => true]
        ]
    ],
]);

```

### Connections retrieving

[](#connections-retrieving)

```
$connections = $app['mongodb'];
$defaultConnection = $connections['default'];

```

### Creating a mongo connection via the factory

[](#creating-a-mongo-connection-via-the-factory)

```
$mongoFactory = $app['mongodb.factory'];
$customConnection = $mongoFactory("mongodb://localhost:27017", ["connect" => true]);
```

Copyright
---------

[](#copyright)

- Sander Toonen

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

3564d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ed6a836af7c6e4ed10b6315812b61104f159203f45f5ef9e9caa67e24ccfa5c?d=identicon)[Sander-Toonen](/maintainers/Sander-Toonen)

---

Tags

databaseprovidermongodbsilexmongo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xatoo-silex2-mongodb-provider/health.svg)

```
[![Health](https://phpackages.com/badges/xatoo-silex2-mongodb-provider/health.svg)](https://phpackages.com/packages/xatoo-silex2-mongodb-provider)
```

###  Alternatives

[moloquent/moloquent

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

120114.2k7](/packages/moloquent-moloquent)[moriony/silex-mongo-provider

Mongo service provider for the Silex framwork.

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

PHPackages © 2026

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