PHP extensions for MongoDB installed on Windows
Download Address https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
Find the corresponding PHP version of the DLL file, download php_mongo.dll , placed in the PHP installation directory in
MongoDB is a cross-platform, document-oriented database that delivers high performance, high availability, and ease of scaling. MongoDB is a concept that works on collections and documents.
A document is a set of key-value pairs. The document has
About the benefits of MongoDB, advantages and so on here is not said, the only thing to talk about is the MongoDB: Database, collection, document, where "set"
is "table" in the corresponding relational database, and "document" corresponds to "line".
MongoDB has been in use for a long time, and the MongoDB data store has not been used for permission access (MongoDB default is set to unrestricted access restrictions), and today it took a little time to study, the results of the study are as
Since the blog program used by this blog is used by Edge development, some properties that are not needed are created dynamically during the development process.
MongoDB is Schema-free, unlike relational databases, where column properties are
MongoDB Foreign mirror access is very slow, so that the choice of MongoDB official website online installation is not reliable. Then, we can choose to install the MongoDB 2.6 binary release package.
Below we install the latest MongoDB 2.6.02 CentOS
Use skip and limit to do data paging as follows:
Code:
Page1 = Db.things.find (). Limit ()
Page2 = Db.things.find (). Skip (limit) page3
= Db.things.find (). Skip (limit). (20)
Note: Can be used for paging, limit is Pagesize,skip
In MongoDB, the Db.collection.find () method is used to retrieve documents from the collection. The Db.collection.find () method returns a cursor that retrieves the document. The Db.collection.findOne () method also performs a read operation,
First, preparatory work
1. Create the table to be read in MongoDB
Create DATABASE Mongotest
Copy Code code as follows:
Use Mongotest;
Inserting data into the user table
Copy Code code as follows:
First run the Easy_install Pymongo command to install the Pymongo driver. Then do the action:Create a connection
Copy Code code as follows:
In [1]: Import Pymongo
In [2]: Connection = Pymongo. Connection (' localhost ', 27017)
MANGODB Installation
1. Download MongoDB installation files, I installed the Windows 64-bit, download the address as follows:
Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.6-signed.msi
2. Create a new MongoDB folder in E-disk
The example of this paper describes the method of Pymongo to control the addition of digital fields in MongoDB. Share to everyone for your reference. The specific analysis is as follows:
This is very practical, for example, we need to give the
Recently, using PHP's MONGO extension for data statistics, there is a timestamp field that has 13 digits in length because it is accurate to milliseconds, but is stored as a string at the beginning:
Copy Code code as follows:
{"_id":
Today outside the whistling wind, can be in a warm cabin writing blog is also a happy North drift. Okay nonsense not to say, today mainly say PHP connection, Operation MongoDB, if you do not see the content of two, do not know how to install the
MongoDB is a document-oriented (document-oriented) database, not a relational database. Document-oriented databases do not have a "line" concept compared to a relational database, instead of a "document" model① in the official website
MongoDB has been used for a long time, and MongoDB-based data storage has not been used to access permissions (MongoDB defaults to unrestricted access restrictions), today took a little time to study, the research results are as follows:Note: The
First, the index base:MongoDB's index is almost identical to the traditional relational database, which includes some basic optimization techniques. Here is the command to create the index:> Db.test.ensureIndex ({"username": 1})You can see whether
1, Vi/etc/yum.repos.d/mongodb-org-3.2.repo 2, add the following [Mongodb-org-3.2]name=mongodb REPOSITORYBASEURL=HTTPS://REPO.M ongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.