Download the PHP package rogerthomas84/ohdm without Composer
On this page you can find all versions of the php package rogerthomas84/ohdm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rogerthomas84/ohdm
More information about rogerthomas84/ohdm
Files in rogerthomas84/ohdm
Package ohdm
Short Description OhDM is a PHP Object Document Mapper (ODM) for MongoDB
License MIT
Homepage https://github.com/rogerthomas84/ohdm
Informations about the package ohdm
OhDM
OhDM is a an ODM which is a simple PHP library that eases the pain of interacting with MongoDB.
Stability
OhDM is a new project, so some things won't work as expected. It's classified right now as in the early stages, and there is a version 1.0.0 which we're classing as stable.
Saying that, things will be introduced to help enhance the library further but it'll be versioned accordingly.
Help Out
The easiest way to help is by forking and raising a PR. All I ask is that you contribute changes back to this repository.
Changes won't be merged unless you've tested (and written tests) for the changes made. We also strive for high test coverage.
Right now, we're sitting at 99.33% coverage, and we would really like to stay around there.
Quick Start
To get started quickly, first you're going to need to setup the configuration object. It's a singleton.
Now you'll need a Collection model. Something like this:
Introduction to Queries
Create a document
Find By ID
The quickest form of find is when you know an objects _id
. OhDM exploits this and implements a quick and easy way to locate them.
Find By Query
OhDM supports finding documents by advanced querying which will also return the item in object form. Spoiler alert: it's as easy as it looks below!
Delete
Delete can be called on any saved document and it will be removed from the database.
Update
As it's an object, just alter the variables and call save()
against it.