Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
MongoDB and PHP
SPECIAL OFFER: Upgrade this ebook with O’Reilly
Preface
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
1. Why Mongo?
The Problem of Objects and Relational Data Structures
The Problem with ORMs
ORMs Are Hairy and Complex
ORMs Aren’t Performant
ORMs Neutered SQL
Complicated Architecture
PHP Is Mostly CRUD
MongoDB, Optimized for Operation
MongoDB Is a Document Database
Document == Array
Databases
Collections
Documents
MongoDB Is Optimized for CRUD Operations
Optimal Interface for Developers
Optimal Performance
Optimal Simplicity
The Value of Consistency
2. PHP, MongoDB, and You
Installing the Driver on Linux or MacOS X
Checking for the Driver
Installing the Driver
Upgrading the Driver
Installing the Driver on Windows
Connecting to a Database
Connecting to a MongoDB Database Server
Selecting a Database
The Basics (CRUD Operations)
Creating/Selecting a Collection
Creating a Document
Important Details about Updating
About Consistency
About fsync
Primary Keys and ObjectIds
About Primary Keys
Reading a Document
About ObjectIds
Retrieving Select Values
Updating a Document
Changing a Value
Adding a Value
Appending a Value to an Array
Upsert and Multiple
Saving a Document
Deleting a Document
The MongoDB Shell
mongo
Using the Shell
Shell Is JavaScript
Administrative Commands
Working with Sets
Querying Sets
Finding (Querying) Data in MongoDB
Pagination with the Cursor
Ranges
Working with Arrays
Finding a Value in an Array
$in
$nin
$all
Matching Entire Arrays
$slice
$size
$elemMatch
Using Dot Notation
Conditionals
Working with Multiple Documents
Updating Multiple Records
Deleting Multiple Records
Working with Indexes
Setting Indexes
Index Order
About Indexes
Compound Indexes
Indexing Arrays
Indexes and Memory
Database References
References Are Not Foreign Keys
When to Use References or Reference versus Embed
How to Create References
Creating Manual References
Creating DBRefs
How to Access DBRefs
Dates and Times
3. Advanced MongoDB
Regular Expressions
Creating a MongoDB Regular Expression
Regular Expressions and Indexes
Aggregation Commands
The Distinct Command
The Group Command
Group Parameters
Group Examples
MapReduce
Overview
findAndModify
GridFS
What Is GridFS?
Using GridFS
Mongofiles
Replication
High Availability
Why Three Nodes?
Really Easy Configuration
Checking the Replica Set Status
Sharding
Gotchas
The $ Problem
The Array != Array Problem
Request Injection Attacks
4. PHP Libraries and Tools
Object Document Mappers (ODM)
Doctrine MongoDB ODM
Active Mongo
Mandango
Tools
MongoQueue
Genghis
RockMongo
Frameworks
Symfony2
Lithium
Zend
Fuel
FatFree Framework
5. Conclusion
About the Author
SPECIAL OFFER: Upgrade this ebook with O’Reilly
Copyright
← Prev
Back
Next →
← Prev
Back
Next →