1. Download the Windows version of the MongoDB database
Download the MongoDB version of Windows to the official download page, 32-bit or 64-bit to choose from your own situation
Http://www.mongodb.org/downloads
2. Installation Preparation
What is MongoDB?
MongoDB is written by C + + language and is an open source database system based on distributed file storage.
In the case of high load, adding more nodes can guarantee the performance of the server.
MongoDB is designed to provide
This article is about MongoDB remote access configuration, not to mention the following, directly to see the detailed steps.
1, first modify the MongoDB configuration file to listen to all the extranet IP
Edit file: /etc/mongodb.conf
The revised
MongoDB is a product between relational database and non relational database, and is the most powerful and relational database in the relational database.
The supported data structure is very loose and is a JSON-like Bjson format, so you can store
Paging through data is one of the most common operations of MongoDB. A typical scenario is the need to display your results in your user interface. If you are dealing with data in batches, it is also important to make your paging strategy correct so
My goal is to achieve:
You can search for articles with one or more keywords.
You can find the relevant articles through the list of keywords in the article.
The results of the query are sorted in descending order of relevance.
Queries are fast
Fragmentation is a way of mongodb expansion. The fragment splits a collection and stores the different parts on different machines. When the collections phase of a database is too large for the current space, you need to add a new machine.
1.mongodb Features
1 MONGO is a document-oriented database that brings together the features of both NoSQL and SQL databases.2 All entities are created on first use.3 does not have strict transaction characteristics, but it ensures that any data
The most important role of the index is to improve query performance in query, if there is no index, MongoDB need to scan the entire collection all documents, and filter eligible document, if the index, Then query only needs to traverse the index of
Intro
Fontend
Vue + Vuex + vue-router for main framework.
Express + Babel + webpack for hot middleware in develop.
Backend
Express for main framework.
MongoDB for database.
Express-mailer for Email.
Build
Core
Node.js & NPMMongodbClone and
In the study of the index of MongoDB is to find a strange problem, set the text index to a string field, but did not use the index when querying. Like what:
Db.tomcat_access_logs.ensureIndex ({url: ' text '});
Db.tomcat_access.logs.find ({url: ' 1
Index typeAlthough the index of MongoDB is the same on the storage structure, it is divided into several types such as unique index (unique), sparse index (sparse), multivalued index (multikey) according to different application layer
To the MongoDB website to download MongoDB software: Mongodb-win32-x86_64-2008plus-ssl-3.0.2-signed.msi,Put it where you want it installed:such as: d:\MongoDB\
2Click to install: Mongodb-win32-x86_64-2008plus-ssl-3.0.2-signed.msi
3Agree to the
The following is an extension I added when I used the MongoDB extension of Codeigniter.Is to use MongoDB Aggregate to implement the Sum method in Mysql/* Controller. php */$ Option = array (Array ('$ Match' => array ('Match _ 1' => 'value _ 1
I. Indexing basics:MongoDB indexes are almost identical to those of traditional relational databases, which also includes some basic optimization techniques. The following command creates an index:> Db. test. ensureIndex ({"username": 1 })You can
Db. copyDatabase ("from", "to", "127.0.0.1: 16161 ");Replace the from library on 127.0.0.1. Copy to the to library.This has an additional benefit. That is, the from database may have deleted the data. We know that the disk space will not be released
1. Query all recordsDb. userInfo. find ();Equivalent to: select * from userInfo;By default, 20 records are displayed on each page. If no record is displayed, you can use the it iteration command to query data on the next page. Note: The it command
Remove () function prototypeDb. collection. remove (, )Example The code is as follows:Copy code // Delete all dataDb. test. remove ()// Delete all data whose _ id is greater than 10Db. test. remove ({_ Id: {$ gt: 10 }}) // Delete a data entry
For example, you can query users whose age is greater than or equal to 20 and whose age is less than 30.Example The code is as follows:Copy code Db. user. find ({"age": {"$ gte": 20, "$ lt": 30 }}) Or query. To query multiple values of a key,
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