2017 © Pedro Peláez
 

library mongoqb

Mongo Query Builder

image

aodto/mongoqb

Mongo Query Builder

  • Monday, May 25, 2015
  • by aodto
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,334 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 64 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

A PHP MongoDB query builder library

Install via Packagist and Composer

Add the following into your composer.json file:, (*1)

{
    "require": {
        "aodto/mongoqb": "*"
    }
}

Then run, (*2)

composer install

Install via Git

git clone git://git@github.com:aodto/MongoQB

Download a zip/tarball

Download the latest version:, (*3)

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

Unit tests

Master branch Build Status, (*5)

Develop branch Build Status, (*6)

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., (*7)

Then run:, (*8)

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

Example usage

Connect to the database

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

Insert a document

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

Update a single document

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

Delete a single document

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

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, (*9)

If you find this software useful please consider donating, thank you =], (*10)

https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif, (*11)

The Versions

25/05 2015

dev-master

9999999-dev https://github.com/aodto/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

25/05 2015

1.3.1

1.3.1.0 https://github.com/aodto/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

03/04 2013

dev-develop

dev-develop https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

28/11 2012

1.3

1.3.0.0 https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

22/11 2012

1.2.1

1.2.1.0 https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

22/11 2012

1.2

1.2.0.0 https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

15/11 2012

1.1

1.1.0.0 https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

mongodb database mongo db

04/11 2012

1.0.1

1.0.1.0 https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

mongodb database mongo db

04/11 2012

1.0

1.0.0.0 https://github.com/alexbilbie/MongoQB

Mongo Query Builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

mongodb database mongo db