PHPackages                             soupmix/mongodb - 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. soupmix/mongodb

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

soupmix/mongodb
===============

Simple MongoDB abstraction layer adapter to handle CRUD operations.

0.8.1(8y ago)2115MITPHP ^7.1

Since May 31Compare

[ Source](https://github.com/soupmix/mongodb)[ Packagist](https://packagist.org/packages/soupmix/mongodb)[ Docs](https://github.com/soupmix/mongodb)[ RSS](/packages/soupmix-mongodb/feed)WikiDiscussions Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (12)Used By (0)

Soupmix
=======

[](#soupmix)

[![Build Status](https://camo.githubusercontent.com/3c9511f631b5c703fa1f3b6fcdada64f3818195150afc4e50f30a046ccdb99cf/68747470733a2f2f7472617669732d63692e6f72672f736f75706d69782f6d6f6e676f64622e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/soupmix/mongodb) [![Latest Stable Version](https://camo.githubusercontent.com/c08004feb4040eea798c20a18075a3ef1a8525d6c8b68d2cc88a6ddaebf58d83/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f6d6f6e676f64622f762f737461626c65)](https://packagist.org/packages/soupmix/mongodb) [![Total Downloads](https://camo.githubusercontent.com/c2247fae001d3e268e59df672b3381c597a98741b59bc8a5840d6b55cd37667a/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f6d6f6e676f64622f646f776e6c6f616473)](https://packagist.org/packages/soupmix/mongodb) [![Latest Unstable Version](https://camo.githubusercontent.com/f79bcd434e987e8025fd906a19e6c4fcf067e8c2753dd0af7e1aa24d4f38e8f7/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f6d6f6e676f64622f762f756e737461626c65)](https://packagist.org/packages/soupmix/mongodb) [![License](https://camo.githubusercontent.com/29946a00b0b0181cdacdf8a2d3a6d1b7490ec2fd32b336f11839ed80e62411e4/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f6d6f6e676f64622f6c6963656e7365)](https://packagist.org/packages/soupmix/mongodb)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/59b667b03400bcba69d3f749cc866bdb67be091d5cbdacd7256412de034167fc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f75706d69782f6d6f6e676f64622f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/soupmix/mongodb/) [![Code Coverage](https://camo.githubusercontent.com/821bce27d22d25611bf19ebcb69aef9e7ffd210d7d9d00e04b359537c922e766/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f75706d69782f6d6f6e676f64622f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/soupmix/mongodb/?branch=master)

Simple MongoDB abstraction layer adapter to handle CRUD operations written in PHP. This library does not provide any ORM or ODM.

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

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install Soupmix.

```
$ composer require soupmix/mongodb "~0.7"
```

This will install Soupmix and all required dependencies. Soupmix requires PHP 5.6.0 or newer, mongodb extension: 1.1.0 or newer, [mongo-php-library 1.0.2](https://github.com/mongodb/mongo-php-library) library or newer form MongoDB.

Documentation
-------------

[](#documentation)

[API Documentation](https://github.com/soupmix/base/blob/master/docs/API_Documentation.md): See details about the db adapters functions:

Usage
-----

[](#usage)

```
// Connect to MongoDB Service
$adapter_config = [];
$adapter_config['db_name'] ='db_name';
$adapter_config['connection_string']="mongodb://127.0.0.1";
$adapter_config['options'] =[];
$config['db_name'] = $adapter_config;
$client = new \MongoDB\Client($adapter_config['connection_string'], $adapter_config['options']);
$m=new Soupmix\MongoDB($config, $client);

$docs = [];
$docs[] = [
    "full_name" => "John Doe",
      "age" => 33,
      "email"    => "johndoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 1,
          "names"=> ["Jack"]
        ],
        "female"=> [
          "count" => 1,
          "names" =>["Jane"]
        ]
      ]
];
$docs[] = [
    "full_name" => "Jack Doe",
      "age" => 38,
      "email"    => "jackdoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 1,
          "names"=> ["John"]
        ],
        "female"=> [
          "count" => 1,
          "names" =>["Jane"]
        ]
      ]
];

$docs[] = [
    "full_name" => "Jane Doe",
      "age" => 29,
      "email"    => "janedoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 2,
          "names"=> ["Jack","John"]
        ],
        "female"=> [
          "count" => 0,
          "names" =>[]
        ]
      ]
];

foreach($docs as $doc){
    // insert user into database
    $mongo_user_id = $m->insert("users",$doc);
}
// get user data using id
$user_data = $m->get('users', $mongo_user_id);

$filter = ['age_gte'=>0];
// update users' data that has criteria encoded in $filter
$set = ['is_active'=>1,'is_deleted'=>0];

$i = $m->update("users", $filter, $set);

$filter = ["siblings.male.count__gte"=>2];

//delete users that has criteria encoded in $filter
$m->delete('users', $filter);

// user's age lower_than_and_equal to 34 or greater_than_and_equal 36 but not 38
$filter = [[['age__lte'=>34],['age__gte'=>36]],"age__not"=>38];

//find users that has criteria encoded in $filter
$docs = $m->find("users", $filter);

```

Contribute
----------

[](#contribute)

- Open issue if found bugs or sent pull request.
- Feel free to ask if you have any questions.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity55

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

Every ~42 days

Recently: every ~100 days

Total

11

Last Release

3255d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd83e5d52a2538fdcddc2d17b3579ce5277473c87f46a12fda2d1ce1276c4e83?d=identicon)[mkorkmaz](/maintainers/mkorkmaz)

---

Tags

databasemongodbadaptersAbstraction Layer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/soupmix-mongodb/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M91](/packages/mongodb-laravel-mongodb)[alcaeus/mongo-php-adapter

Adapter to provide ext-mongo interface on top of mongo-php-library

47012.6M74](/packages/alcaeus-mongo-php-adapter)[moloquent/moloquent

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

120115.7k7](/packages/moloquent-moloquent)[doesntmattr/mongodb-migrations

Managed Database Migrations for MongoDB

23612.1k1](/packages/doesntmattr-mongodb-migrations)[facile-it/mongodb-bundle

Bundle service integration of official \[mongodb/mongo-php-library\](https://github.com/mongodb/mongo-php-library) driver library

38231.7k1](/packages/facile-it-mongodb-bundle)

PHPackages © 2026

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