forked from crodas/ActiveMongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
35 lines (26 loc) · 1.6 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Really simple Activedocument for MongoDB
----------------------------------------
MongoDB is a very powerful database, high performance and amicable. I wrote an article about it,
http://www.phpclasses.org/blog/post/118-Developing-scalable-PHP-applications-using-MongoDB.html
ActiveMongo, is a simple yet efficient MongoDB abstraction, following the Activedocument pattern. Visit http://crodas.org/activemongo.php for further details.
Comments, patches, bug reports are welcome to the blog post, my personal e-mail address, [email protected]
What it does now:
- Handle MongoDB connection, connecting once when it is needed
- Define a Collection as a class
- Abstracts iteration over a dataset
- Efficient save() which creates or updates efficiently (using $unset, $set) a document
- Provides simple queries interface, but allows to get MongoCollection for complex queries in sub-classes
- Delete current object, Drop() table
- Support filtering per property
- Support for efficient updates on nested documents
- Support Hooks:
- pre_save($operation, Array &$document): Right before to perform and insert or update
- on_save(): When a document is created
- on_update(): When a document is updated
- on_iterate(): On iteration, when the cursor moves to the next document
- Support simple yet useful collection installation, useful to create indexes and shard keys.
- Efficient references to another document, and an efficient way to load it (with one query if possible)
- Dynamic References (AKA, save a query to execute later)
TODO:
- PHP Streams support for GridFS
- Tools for setup and manage a sharded environment