Find it more and more lazy recently ... One months an article--!
Environment: Windows 7, IIS7, php5.3.5, MongoDB 2.6
The overall steps are:
Install
MongoDB, install the MongoDB extension of PHP, and install MongoDB as a service.
Index: A special data structure that stores a small portion of the data in a table to enable quick queries
Advantages:
1, greatly reducing the amount of data the server needs to scan
2, the index can help the server avoid sorting or use temporary
Gridfs Introduction
Gridfs is a built-in feature in MongoDB that can be used to store a large number of small files.
Gridfs use
MongoDB provides a command line tool mongofiles can handle Gridfs,
List all Files:
Copy Code code as follows:
Java operation of the MySQL database code we already know, delete and change, Java to MongoDB database is similar operation, first database connection, and then operation.
First we enter into the admin database, and then set up their own database
MongoDB is an open source NoSQL database that is primarily used in large data situations and is considered the Node.js's golden partner, and because it uses the binary JSON format, it has no affinity to JavaScript with any language. The specific
For example, limit the memory size of the MongoDB.
mkdir/cgroup/memory/test/
echo 50M >/cgroup/memory/test/memory.limit_in_bytes
echo 50M >/cgroup/ Memory/test/memory.memsw.limit_in_bytes
cgexec-g memory:test mongod-port 27017--bind_ip 127
The first attempt to connect to the MongoDB database today is a simple step.
First, install the MongoDB package through the Nodejs running environment, enter the directory to be installed, execute the statement
NPM install MongoDB After a
Objective
It is well known that the current use of Node.js + MongoDB has become a technology stack for many companies. Thinkjs actually provides support for MONGO, although the official documentation is small, but the ORM API is guaranteed to be
One, write performance test script[Email protected] bin]#/mongo 172.27.8.118:40000sharding_2:primary> Use adminSwitched to DB adminSharding_2:primary> Db.auth (' WLAN ', ' WLAN ')Sharding_2:primary> Use EstestdbnewSwitched to DB estestdbnew for (Var
MongoDB as a document database, support shard storage, scale-out, cluster automatic switch, the following summary configuration steps summarized as follows:Several important concepts:Database: Collection--record--cursor (tag ordinal at
MongoDB Data BackupIn MongoDB we use the Mongodump command to back up MongoDB data. The command can export all data to the specified directory.The Mongodump command allows you to specify the server to which the exported data can be dumped by
Mongodb# similar to the in or or operation in SQL mulites field query: db.cool.find ({$or: [{field1: ' val '},{' field2 ': ' Val '} ...]})# Similar to SQL Db.coo.find (' name ':/m/) = = SQL like Pymongo using {' field ': {$regex: keyword}}http://
When the database is indexed, by default, "foreground" is the foreground index, but when you have a large amount of database data, when the index will be read data files, a large number of file read and write will prevent other operations, at the
When you call the Save method of Mongotemplate, Spring-data-mongodb TypeConverter automatically adds a _class attribute to the document, and the value is the name of the class you saved. There's no harm in this design. Spring-data-mongodb is
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/
Inserting some data into the student collectionDb.student.insert ({"Study No.": 10010, "name": "De Levin", "Age": 26, "Address": "Zibo"}), var studata1={"study number": 10020, "name": "Obama", "age": 27, "Address": "Azeroth"};d B.student.insert
"Note: MongoDB automatically sets the _id field as the primary key"--------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
Today, in a demo environment, our products experienced the entire engine room power outage, there is a MongoDB binary file corruption, the following is a breakdown of the analysis of the recording process:1. In the customer support colleagues found
MongoDB is a nosql type of database, high-performance, easy to deploy, easy to use features in the IT industry is very popular.The following describes the installation of MongoDB, here we are installed under Linux, using the centos6.4 64-bit, you
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service