This article describes the details of the Windows Platform installation MongoDB database, as follows
Official website: www.mongodb.orgInstall--> set environment variable--> start
1. Download:
Download the 32-bit or 64-bit. msi file according to
I. Overview
Recently to install MongoDB on the new CentOS system, a certain degree of results directly from the MONGO official website directly obtained 3.2 version of the download link, the results found in the download of poor speed. Forced
MongoDB installation method for details please see: MongoDB installation method
Configure the MONGODB environment variables and benefits
Today we'll talk about how to configure MongoDB's environment variables and benefits, because every time we
photos;//Select database
$grid = $db-> Getgridfs (); Get Gridfs Object
Gridfs has three ways of storing files
The first type of direct storage file
$id = $grid->storefile ("./logo.png");
Second storage file binary stream
$data = Http://www.
Because the shell operation MONGO more troublesome, had to try to use Perl operation Mongo,perl need to operate MongoDB must first install the appropriate driver, most people use CPAN installation, personal feel too troublesome, use Cpanm install
First, install MongoDB
1. Download Address: Http://www.mongodb.org/downloads
2. Unzip to the directory you want to install, such as D:\mongodb
3. Create folders d:\mongodb\data\db, D:\mongodb\data\log, respectively to install DB and log files,
MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications. The MongoDB index is almost the same as the index of a relational
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:
MySQL and MongoDB are open source common database, but MySQL is a traditional relational database, MongoDB is a relational database, also known as a document database, is a NoSQL database. They each have their own advantages, the key is to see where
One, MongoDB to MySQL commonly used SQL statement corresponding realization
Copy Code code as follows:
——————————————
Mysql:
SELECT * from user
Mongo:
Db.user.find ()
——————————————
Mysql:
SELECT * FROM user WHERE name = ' Foobar
Gridfs Introduction
MongoDB documents are stored in the Bson format and support binary data types when we save data in binary format directly to MongoDB documents. But when files are too large, such as pictures and videos, the length of each
First, insert a Bjson data into the database
First, define the document, then log in with the admin username password, enter the test database, and insert this document into the test database ("table name and records in table")
Insert the
First, documentation considerations:
1. Key-value pairs are ordered, such as: {"name": "Stephen", "Genda": "Male"} is not equal to {"Genda": "Male", "name": "Stephen"}2. Document information is case sensitive, such as: {"name": "Stephen"} is not
Using the MongoDB database, you need to add user rights to each database, check the following code:
Copy Code code as follows:
Use Test2
Db.adduser ({User: "Test")
PWD: "Admin",
roles: ["ReadWrite", "Dbadmin"]
} )
Last week in Ruby-china posted "MongoDB those pits", reflected quite enthusiastic, many reply very insightful, one of the children's shoes in-depth mention of the MongoDB indexing method, which led me to a more in-depth understanding of the MongoDB
1. First download the MongoDB installation package at the official website:
Http://www.mongodb.org/downloads
Here we download the zip format of the download, the other did not install, will not, will not say.
2. After extracting the file:
3.
Capped collections is a high performance automatic maintenance object Insertion Order. It is ideal for logging-like functionality
Create a Capped Collection
Unlike standard collection, you have to explicitly create a capped collection,Specifies
MongoDB basic operation of the increase and deletion checkWe know that the most common operation of a traditional relational database is "Add/remove/Modify/query", i.e.The legendary crud (Create/remove/updte/delete).In learning MongoDB, we also
1. PreparationsAfter installing pymongo through pip or easy_install, you can use Python to call mongodb.Then install a flask to serve as a web server.Of course, mongo has to be installed. For Ubuntu users, especially those who use Server 12.04, it
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.