Today and everyone to share a python into the library MongoDB script ...When it comes to Python and MongoDB, it is necessary to install the appropriate module, the simplest installation method, or non-PIP.# pip Install pymongo==3.0.4By the way also
MongoDB supports a list of many data types as given below:
String: This is the most commonly used data type to store data. The string in MongoDB must be a valid UTF-8.
Integer: This type is used to store a numeric value. The integer can
MongoDB installation and simple useFirst install MongoDB1.:http://www.mongodb.org/downloads2. Unzip to the directory you want to install, such as D:\mongodb3. Configure the environment variable, the installed directory Path:d:\mongodb\bin added in
1. Introduction: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.MongoDB is a product between a relational database and
In MongoDB, a database might contain multiple collections, just as a database in MySQL might contain multiple tables, and a collection might contain multiple documents, just as a table in MySQL contains more than one piece of data.Basic Operations
Sven Slootweg (joepie91) is a hacker and founder of CRYTOCC and now provides the node. JS Code Review Service. Recently, he published a blog post on the "Why you should never, never, never again use MongoDB." In the article, he cites the following
MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bjson format,
Project database from the previous MySQL changed to MongoDB, because often not in the company, it must be able to remotely access the MONGDB database, so on the Internet to check some information, here to organize records down1. Installing MongoDB2.
Index is used to speed up the query, here does not explain the principle of indexing and data structure, in fact, most of the database index is b+tree, want to understand the students can see the index principle, to master how to configure the best
: https://www.mongodb.org/In the installation directory, the key is a datastore folder (data)Then, build a start.bat (boot file, of course you can also start each time using the command line), write in the Mongod--dbpath./data then save, click on
in the command line, enter the MongoDB the installation directory
Mongod.exe--dbpath
Note: --dbpath is the folder location of Mongodbdata
For example:
Mongod.exe--dbpathd:\java_tools\mongodb\mongodbdata
!--
Mainly two, one is to use the numerical range Division, one is a hash, a bit similar to the memcached cluster mechanism.The following table compares the pros and cons
sharding Algorithm
Range Query Performance
Querying an existing database
>show DBS2. Create a database, you need to create a collection this Coucay creates>use MyDB3. View Collections>show Collections or >show tables4. Create a document and insert data>db.userinfo.insert ({_id:1,name:
MongoDB Modify, delete the domain attribute instance of the document in the development of the Web site, may initially unreasonable design, or late business changes, will cause the document structure will have some useless attributes, need to remove
1. First download the appropriate installation package to the official website (http://www.mongodb.org/downloads)Select the appropriate version to download according to your system.2. According to the prompt to install, I installed in the C drive (I
OverviewShard Sharding is the separation of different data on different servers.Modelamong them:The user's operation to MongoDB is requested by the mongs.CONFIGSVR is used for saving, which data is stored on which shardHow to use ShardsStart 2 nodes
Mongodb Study Notes 09 -- shard shardingOverview
Shard sharding divides different data into different servers.
Model
Where:
Partition + vH87XEPGJyIC8 + DQpjb25maWdzdnIg08PT2rGjtOajrMSzzPXK/partition = "how to use a partition"> how to use a
Be alert to InnoDB and MyISAM Hash index creation trapsMySql common storage engines InnoDB and MyISAM do not support Hash indexes. Their default indexes are B-Tree. However, if you define the index type as Hash when creating the index, MySql will
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