In the recent work need to use MongoDB, here to do some simple records, blog post content can be found in the official MongoDB reference manual, here is just a few summary and explanation.Installation Environment:Os:windows 7, 32-bitmongodb:3.0.6, currently the latest version(1) Download the package that matches the system, you choose according to the system situ
, indicating that the recordis a meet the requirements. As for this example, it is certainly easy to do so with other queries. It's easy to demonstrate and easy to do. $where Query method is suitable for complexof the query. It's very powerful, but it's not recommended, it's going to sacrifice performance, but I don't know about that. As for what to add, think about it later.(9) Limit () function: How many records to take. For example: Db.customer.find (). Limit (5), which is to fetch the previo
helpful. The order of a single column index does not affect the query of the key immediately. Create a single column index:
> db.people.ensureIndex({"name" : 1})
3). Composite Index
You can also create a composite index on multiple keys. The key position and index order affect the query efficiency. See the following:
> db.people.ensureIndex({"name" : 1, "age" : 1})> db.people.ensureIndex({"age" : 1, "name" : 1})
In the first case, the Organization is
Share 7 top CSS 3 animation effects and 7 top CSS 3 Effects
1. CSS3 SVG text background animation cool text effects
Today, we will share a special text effect based on CSS3 and SVG. The text background can define some animation effects. When playing the background animation, we can also select the text. In this example
Lesson 4 MongoDB Data Query (1): mongodb Data Query1. Course outlineThis course mainly describes MongoDB Data Query related content, including the introduction and use of the find function, query operator introduction and use, embedded document query, and array query. 1. Introduction and use of the find function 2. int
In order to omit the space and make it visible to the operator who manually fills in the paper, the volume number on the card of the materials shelf is determined to be classified and sorted, as shown in
A-3, A-4, A-5, A-8 forming A-3 ~ 5, 8, etc.
The following code uses a few auxiliary list
/// /// Similar to 1, 2, 3
How to learn: read it in detail and implement the relevant code manuallyLearning Goals : This tutorial will teach you to install node, build servers, Express, MySQL, MongoDB, write background business logic, write interfaces, and finally complete a complete project backstage, a total of 10 days is expected.node. js Operation MangodbCreate a folder for placing today's files, NPM init initializes, and creates demo1.js for writing node codeInstall the
The seventh chapter recommends 4 hours of study time 10 chaptersHow to learn: read it in detail and implement the relevant code manuallyLearning Goals : This tutorial will teach you to install node, build servers, Express, MySQL, MongoDB, write background business logic, write interfaces, and finally complete a complete project backstage, a total of 10 days is expected.node. js Operation MangodbCreate a fol
Can I upgrade ios8.2 to iPad 2/3/4?The ios8.2 system supports the upgrade of ios8.2 for ipad 2 for iPad 3 for iPad miniiPad 4. The details are as follows:IPad 4IPad 4 (generation model A1458) WIFI (iPad3, 4)IPad
, you can configure MongoDB to store data on different disk devices to increase write throughput or disk capacity. The default value is false. # It is recommended that you configure the option at the beginning.
Directoryperdb = true # disable logs # enable operation logs corresponding to journal to ensure the write persistence and data consistency. The journal directory is created under the dbpath directory.
Nojournal = true ##
Max connections # maxim
/mongodb-linux-x86_64-3.2.3.tgz./
TAR-ZXVF mongodb-linux-x86 _64-3.2.3.tgz
MV mongodb-linux-x86_64-3.2.3 MongoDB
So you can get the final MongoDB folder, inside the file structure is as follows: The bin folder is the main program directory of
First, start the MongoDB shelltool, that is, bind the cmd.exe
Common shell commands are as follows:
1. query the names of all local databases
> show dbs;
2. Switch to the specified database environment (if no database is specified, a new database is created)
> use dbtest;
Switch to the dbtest database or create a database named dbtest.3. query all collection sets in the current database (equivalent to table
mongodb and show dbs to view the admin database.
3-> db. addUser ("root", "123456"); Press enter to create a super administrator. Press enter to have a value readOnly: false to indicate readable and writable.
4-> exit -- set it and you will find that everything is useless. log out and log on again.
5->./mongo-h -- check the parameter-u-p.
6->./mongo localhost: 2
+ Skip + Sort mash upOne example: Select the second third and sort by price in ascending orderThe problem arises, shouldn't it be 9800 and then 19800?Here's the point of knowledge.Emphasis: Sort + skip + Limit is the priority of their subsectors are priority sort followed by Skip last LIMTSkip + Limit Priority is also the first skip and then limitSee once, can't rememberLook two times, it won't work.See three times, do it yourselfDo it once, it's better to do it three times.Practice a deeper im
MongoDB Series 3: MongoDB user permission operations
After preliminary research on configuration and basic understanding, the following section describes MongoDB's user permission operations.
Brief Introduction:
Like all other databases, permission management is similar. Mongodb stores all user information in the admin
Tags: style blog http color io strong SP data onMONGOBD's query is plainly a find () method. But it's still a little complicated. Come on(1) Query all data: DB. Collection name. Find (); There's nothing to say.(2) Query the first data: DB. Set name. FindOne (); There's nothing to say.(3) Condition query: DB. Set name. Find (query condition), query condition is also a kind of JSON format. So understanding JSON is really important to learn about MongoDB
("5198c286c686eb50e2c843b5"), "name": "user3", "age": 3}
{"_ Id": ObjectId ("5198c286c686eb50e2c843b6"), "name": "user4", "age": 4}
$ Type query by Data type
Each data type in mongodb has corresponding numbers. We need to use these numbers when using $ type. The document provides the following representation:
Type Number
Double Precision 1
String 2
Object
References: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
The procedure is as follows:
1. Download MongoDB from official website: http://www.mongodb.org/
Because 2.0 has been released, MongoDB 2.0.6 is used here.
2. Download and decompress the package to the C root directory (or any other place ).
For ease of operation, you can change t
for sharding for any set. Assume that the test database is slidetest.
Note: It looks a bit similar to the index definition, especially the unique key. When sharding is performed for an empty set, mongodb creates an index for each shard. You can directly link the parts and run getIndexs () for verification. You can log on to 3000 to view the information.
Ii. Write to sharded Cluster
Once the sharding of the set is completed, the sharding cluster is
Label:In this article we look at MongoDB as an administrator, and as an administrator, there are 4 main areas that we often come into contact with: 1. Installation deployment 2. Status monitoring 3. Security Certifications 4. Backup and Recovery, Here we will explain 1.1. One: Installation deployment My previous artic
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.