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

Abandoned → Use Doctrine ODMArchivedLibrary[Database &amp; ORM](/categories/database)

prgtw/mongoqb
=============

Obsolete Mongo Query Builder

6.6.7(8y ago)12.2k1MITPHPPHP &gt;=5.3.0

Since Nov 4Pushed 8y ago2 watchersCompare

[ Source](https://github.com/prgTW/MongoQB)[ Packagist](https://packagist.org/packages/prgtw/mongoqb)[ Docs](https://github.com/alexbilbie/MongoQB)[ RSS](/packages/prgtw-mongoqb/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (1)Versions (12)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": {
		"alexbilbie/mongoqb": "*"
	}
}
```

Then run

```
composer install
```

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

[](#install-via-git)

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

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

[](#download-a-ziptarball)

Download the latest version:

- [zip](https://github.com/alexbilbie/MongoQB/archive/master.zip)
- [tar](https://github.com/alexbilbie/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/37369404d3e6b3b8f1982f7f25c532315c083e30b323e269c29e65e87a4703c5/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616c657862696c6269652f4d6f6e676f51422e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/alexbilbie/MongoQB)

Develop branch [![Build Status](https://camo.githubusercontent.com/5a03f9b5ba13399865f0021cac72a7102b727fde33e2aaca5d95a7d6ad3a6ecc/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616c657862696c6269652f4d6f6e676f51422e706e673f6272616e63683d646576656c6f70)](https://travis-ci.org/alexbilbie/MongoQB)

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/alexbilbie/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/alexbilbie/MongoQB/Issues)

If you find this software useful please consider donating, thank you =\]

[![https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif](https://camo.githubusercontent.com/0293c3ea1e6dbe13508306375f69c8d21d79fce0478eb6f60e84c512d7e5192c/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f47422f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MWFMPM8LDQ7GC)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 90.2% 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 ~226 days

Recently: every ~448 days

Total

9

Last Release

3128d ago

Major Versions

1.3.1 → 6.6.62016-03-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/69f6df2cde2ee864e1ea5ec591e9a586ed97994c87996944194ef03e2ad63086?d=identicon)[prgTW](/maintainers/prgTW)

---

Top Contributors

[![alexbilbie](https://avatars.githubusercontent.com/u/77991?v=4)](https://github.com/alexbilbie "alexbilbie (83 commits)")[![prgTW](https://avatars.githubusercontent.com/u/203249?v=4)](https://github.com/prgTW "prgTW (7 commits)")[![kolah](https://avatars.githubusercontent.com/u/448553?v=4)](https://github.com/kolah "kolah (1 commits)")[![lbarulski](https://avatars.githubusercontent.com/u/2803144?v=4)](https://github.com/lbarulski "lbarulski (1 commits)")

---

Tags

databasedbmongodbmongo

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/prgtw-mongoqb/health.svg)](https://phpackages.com/packages/prgtw-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)
