PHPackages                             jumplead/mongoqb - 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. jumplead/mongoqb

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

jumplead/mongoqb
================

Mongo Query Builder

1.3.4(7y ago)18.9kMITPHPPHP &gt;=5.3.0

Since Nov 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Jumplead/MongoQB)[ Packagist](https://packagist.org/packages/jumplead/mongoqb)[ Docs](https://github.com/Jumplead/MongoQB)[ RSS](/packages/jumplead-mongoqb/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (11)Used By (0)

A PHP MongoDB query builder library
===================================

[](#a-php-mongodb-query-builder-library)

Install via Packagist and Composer
----------------------------------

[](#install-via-packagist-and-composer)

Add the following into your composer.json file:

```
{
	"require": {
		"jumplead/mongoqb": "*"
	}
}
```

Then run

```
composer install
```

Install via Git
---------------

[](#install-via-git)

```
git clone git://git@github.com:jumplead/MongoQB
```

Download a zip/tarball
----------------------

[](#download-a-ziptarball)

Download the latest version:

- [zip](https://github.com/jumplead/MongoQB/archive/master.zip)
- [tar](https://github.com/jumplead/MongoQB/archive/master.tar.gz)

(Note the zip/tarball won't include any unit tests or composer files)

Unit tests
----------

[](#unit-tests)

Master branch \[[![Build Status](https://camo.githubusercontent.com/be77ea950caf7aad247d911cd101b3b6ad5264e66f1dd19041e7d7f17bf24338/68747470733a2f2f7472617669732d63692e6f72672f4a756d706c6561642f4d6f6e676f51422e737667)](https://camo.githubusercontent.com/be77ea950caf7aad247d911cd101b3b6ad5264e66f1dd19041e7d7f17bf24338/68747470733a2f2f7472617669732d63692e6f72672f4a756d706c6561642f4d6f6e676f51422e737667)

The library currently has 100% unit test coverage. To run the unit test suite make sure you have MongoDB installed locally and running with no authentication and on the default port - 27017.

Then run:

```
composer update --dev
cd vendor/jumplead/mongoqb
phpunit -c tests/phpunit.xml
```

Example usage
-------------

[](#example-usage)

### Connect to the database

[](#connect-to-the-database)

```
$qb = \MongoQB\Builder(array(
	'dsn'	=>	'mongodb://user:pass@localhost:27017/databaseName'
);
```

### Insert a document

[](#insert-a-document)

```
$qb->insert('collectionName', [
	'name'	=>	'Alex',
	'age'	=>	22,
	'likes'	=>	['whisky', 'gin']
]);
```

### Update a single document

[](#update-a-single-document)

```
$qb
	->where(['name' => 'Alex'])
	->set([
		'country' => 'UK',
		'job' => 'Developer'
	])
	->push('likes', ['PHP', 'coffee'])
	->update('collectionName');
```

### Delete a single document

[](#delete-a-single-document)

```
$qb
	->where(['name' => 'Alex'])
	->delete('collectionName');
```

### Search for matching documents

[](#search-for-matching-documents)

```
$results = $qb
	->whereGt('age', 21)
	->whereIn('likes', ['whisky'])
	->where('country', 'UK')
	->get('collectionName');
```

If you find any bugs please file a report in the [Issue tracker](https://github.com/jumplead/MongoQB/issues)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.4% 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

Every ~232 days

Recently: every ~516 days

Total

10

Last Release

2849d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/809944?v=4)[Adam Curtis](/maintainers/adamlc)[@adamlc](https://github.com/adamlc)

---

Top Contributors

[![alexbilbie](https://avatars.githubusercontent.com/u/77991?v=4)](https://github.com/alexbilbie "alexbilbie (83 commits)")[![adamlc](https://avatars.githubusercontent.com/u/809944?v=4)](https://github.com/adamlc "adamlc (10 commits)")[![nojacko](https://avatars.githubusercontent.com/u/1667141?v=4)](https://github.com/nojacko "nojacko (2 commits)")

---

Tags

databasedbmongodbmongo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jumplead-mongoqb/health.svg)

```
[![Health](https://phpackages.com/badges/jumplead-mongoqb/health.svg)](https://phpackages.com/packages/jumplead-mongoqb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[danielme85/laravel-log-to-db

Custom Laravel Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel native logging functionality.

135934.5k1](/packages/danielme85-laravel-log-to-db)[moloquent/moloquent

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

120114.6k7](/packages/moloquent-moloquent)[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)
