Git Product home page Git Product logo

mongolid's Introduction

Mongolid ODM for MongoDB (PHP7)

Easy, powerful and ultrafast ODM for PHP7 build on top of the new mongodb driver.

Mongolid

Mongolid supports both ActiveRecord and DataMapper patterns. You choose! (:

Build Status Codacy Badge StyleCI Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

SensioLabsInsight

Introduction

Mongolid ODM (Object Document Mapper) provides a beautiful, simple implementation for working with MongoDB. Each database collection can have a corresponding "Model" which is used to interact with that collection.

Note: If you are working with Laravel, take a look at mongolid-laravel repository.

Installation

You can install library through Composer:

$ composer require leroy-merlin-br/mongolid

Requirements

Note: If you are looking for the old PHP 5.x version, head to the v0.8 branch.

Mongolid Docs

Troubleshooting

"PHP Fatal error: Class 'MongoDB\Client' not found in ..."

The MongoDB\Client class is contained in the new MongoDB driver for PHP. Here is an installation guide. The driver is a PHP extension written in C and maintained by MongoDB. Mongolid and most other MongoDB PHP libraries utilize it in order to be fast and reliable.

"Class 'MongoDB\Client' not found in ..." in CLI persists even with MongoDB driver installed.

Make sure that the php.ini file used in the CLI environment includes the MongoDB extension. In some systems, the default PHP installation uses different .ini files for the web and CLI environments.

Run php -i | grep 'Configuration File' in a terminal to check the .ini that is being used.

To check if PHP in the CLI environment is importing the driver properly run php -i | grep -i 'mongo' in your terminal. You should get output similar to:

$ php -i | grep -i 'mongo'
MongoDB support => enabled
MongoDB extension version => 1.2.8
MongoDB extension stability => stable
libmongoc bundled version => 1.5.5

"This package requires php >=7.0 but your PHP version (X.X.X) does not satisfy that requirement."

The new (and improved) version 2.0 of Mongolid requires php7. If you are looking for the old PHP 5.x version, head to the v0.8 branch.

License

Mongolid is free software distributed under the terms of the MIT license

Additional information

Mongolid was proudly built by the Leroy Merlin Brazil team. See all the contributors.

Any questions, feel free to contact us.

Any issues, please report here

mongolid's People

Contributors

ckd avatar diegofelix avatar flambe avatar gmsantos avatar guilhermeguitte avatar manc avatar ravanscafi avatar rplansky avatar zizaco avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.