PHPackages                             rcastera/mongo - 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. rcastera/mongo

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

rcastera/mongo
==============

Mongo Abstraction Class

v1.0.0(12y ago)151MITPHPPHP &gt;=5.3.0

Since Sep 29Pushed 12y ago2 watchersCompare

[ Source](https://github.com/rcastera/Mongo-Abstraction-Class)[ Packagist](https://packagist.org/packages/rcastera/mongo)[ Docs](http://www.richardcastera.com)[ RSS](/packages/rcastera-mongo/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Monga
=====

[](#monga)

A simple class for working with MongoDB. Those new to Mongo, should go through the [SQL to Mongo Mapping Chart](http://www.php.net/manual/en/mongo.sqltomongo.php)

### Setup

[](#setup)

---

Add a `composer.json` file to your project:

```
{
  "require": {
      "rcastera/mongo": "v1.0.0"
  }
}
```

Then provided you have [composer](http://getcomposer.org) installed, you can run the following command:

```
$ composer.phar install
```

That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library (if you don't already have one).

```
require 'vendor/autoload.php';
```

Then you need to `use` the relevant class, and instantiate the class. For example:

### Getting Started

[](#getting-started)

---

```
require 'vendor/autoload.php';

use rcastera\Database\Mongo\Monga;

$mongo = new Monga();
```

### Examples

[](#examples)

---

##### Find all documents from contacts collections.

[](#find-all-documents-from-contacts-collections)

```
