The following things should be understood by PHP programmers.For more details, refer to Baidu Google
MongoDB PHP document http://us.php.net/manual/en/book.mongo.php
1. MongoDB is a separate server
2. MongoDB is based on documents rather than tables.
3. Less MongoDB Schema
4. You do not need to learn another language
5. MongoDB has good PHP support
1. MongoDB is a separate server.
Code text is like MySQL and PostgreSQL. MongoDB listens to the connected connection. The tools provided by him include inquiry, creation, update, and deletion. In theory, they work like MySQL and PostgreSQL: Link, process, and close the connection.
2. Say goodbye to rows and tables. Welcome documents and collectors.
MongoDB stores data in documents instead of tables and rows that store data. Suppose we have an "article" with a title. It has multiple authors, one topic, and one tag. All of these look like the following:
PHP array (
'Title' => 'Hello world', 'authors '=> array ('john', 'Sally', 'Jim '), 'body' => 'Hello world ', 'tags' => array ('tag1', 'tag2', 'tag3');?>
Install PHP support
Need to download php_cmd.dll https://github.com/mongodb/mongo-php-driver/downloads
Set PHP. ini to enable. Open PHP. ini and add the following sentence.
Extension = php_cmd.dll
Management Tool Selection
There are many management tools available, refer to http://blog.nosqlfan.com/html/213.html
A management tool is recommended below:Rockmongo
Rockmongo is a MongoDB management tool written in PhP5.
Main features:
Open-source and easy to install
You can manage multiple hosts or add multiple administrators for each host.
Password required for login
Query Databases
Powerful collection query function
Add, delete, modify, query, and copy a single row
Query, create, and delete Indexes
Clear collection
Batch Delete and modify data, but later versions of php_mongo are required.
View Collection statistics
More useful feature development ..
Download rockmongo: Http://code.google.com/p/rock-php/downloads/list
PHP-based MongoDB management tools are similar to phpMyAdmin management tools. phper is easy to get started.
My downloaded example -latest-php5.3vc6.zip. The web page in the downloaded package is the management interface.
Rename the Web Folder rockmongo and put it in the Development website file. Mine is E: \ XAMPP \ htdocs \ rockmongo. Open the browser and enter: http: // localhost/rockmongo.
The following interface is displayed:The default Administrator and password are admin, and the language options and logon time settings are supported.
Login interface:
This is the management interface. programmers can easily get started with phpMyAdmin.