2017 © Pedro Peláez
 

library utils-mongodb

Collections of small tools for MongoDB.

image

photon/utils-mongodb

Collections of small tools for MongoDB.

  • Wednesday, May 24, 2017
  • by delkia
  • Repository
  • 2 Watchers
  • 0 Stars
  • 909 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

utils-mongodb

Build Status, (*1)

Various useful tools for MongoDB, (*2)

PHP Versions

  • 5.6, 7.0 and 7.1 are supported and tested under travis
  • Use ext-mongodb and mongodb/mongodb. Do not works anymore with legacy ext-mongo

Quick start

1) Add the module in your project, (*3)

composer require "photon/utils-mongodb:dev-master"

or for a specific version, (*4)

composer require "photon/utils-mongodb:2.0.0"

2) Define a MongoDB connection in your project configuration, (*5)

'databases' => array(
    'default' => array(
        'engine' => '\photon\db\MongoDB',
        'server' => 'mongodb://localhost:27017/',
        'database' => 'utils',
        'options' => array(
            'connect' => true,
        ),
    ),
),

3) Enjoy !, (*6)

Counters

The counter class implement a atomic counter increment and retreive. It's a thread safe auto-increment., (*7)

1) Create a class to define a counters collection, (*8)

class MyCounter extends \photon\utils\mongodb\Counter
{
    const database = 'default';
    const collection = 'counters';
}

2) Read / Write counter, (*9)

    $value = MyCounter::get('foo');     // = 0
    $value = MyCounter::inc('foo');     // = 1
    $value = MyCounter::get('bar');     // = 0
    $value = MyCounter::get('foo');     // = 1

The Versions

24/05 2017

dev-master

9999999-dev http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils

24/05 2017

v2.1.0

2.1.0.0 http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils

18/04 2017

v2.0.1

2.0.1.0 http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils

18/04 2017

v2.0.0

2.0.0.0 http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils

08/06 2016

v1.0.2

1.0.2.0 http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils

08/06 2016

v1.0.1

1.0.1.0 http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils

08/12 2015

v1.0.0

1.0.0.0 http://www.photon-project.com/

Collections of small tools for MongoDB.

  Sources   Download

LGPL-2.1

The Requires

 

by William MARTIN

mongodb photon utils