1. Open "Run" (win+r), enter "Services.exe" to confirm the existence of MongoDB service
2. Run cmd, use SC command to manage Windows service (if you cannot delete successfully, run cmd as an administrator)
3. If the MongoDB service is
Turn from: http://www.chengxuyuans.com/syskills/Windows7/66110.html
1. Python Installation
Download: http://python.org/download/
Double-click the installation and add the path to the system environment variable path after installation.
2. MongoDB
MongoDB: Database, collection, document, where "set" is the corresponding relational database "table", "document" corresponding to the "line".1, first of all, download the MongoDB Java-supported driver package
org.mongodb
Lead: db.keyword.distinct ("keyword"). length
As follows:
Db.keyword.distinct ("keyword"). length
View the total number of records in the keyword table that do not duplicate keyword fields
This method is not seen in the official document, try to
Original works, allow reprint, please be sure to use hyperlinks in the form of the original source of the article, author information and this statement. Otherwise, the legal liability will be investigated. http://elain.blog.51cto.com/3339379/760266
Recently has been looking at MongoDB book, but the practice is not much, today at noon using the rest, the virtual machine was installed, operating system for cent OS 6.2 (64-bit). The following records are as follows;
1 Download the installation
focus on MongoDB sum of a field sum
New Basicdbobject ("$group", New Basicdbobject ("_id", "$number"). Append ("Total", New Basicdbobject ("$sum", "$" + "length ")));
New Basicdbobject ("_id", "$" +queryfield) is a fixed format
GROUP BY query
Data persistence: Persistent Data persistence method: 1. File read/write 2.cookie, server stored in the client's data, the client will automatically send the cookie to the server (the cookie is stored in the HTTP header), Session + Cookie
On the left is the MONGODB query statement, and the right is the SQL statement. Compared with the use, very convenient.
Db.users.find () SELECT * from Users
Db.users.find ({"Age": +}) SELECT * from the users where age = 27
Db.users.find ({"username":
1. Start MongoDB service without access controlsudo service Mongod start2. Connect to an instanceMONGO--port 27017Specify additional command-line options to connect the MONGO shell to the deployment MongoDB server, such as--host3. Created User
Environmental dependencyIntroduce spring-boot-starter-data-mongodb dependencies in the Pom file: org.springframework.boot Spring-boot-starter-data-mongodb Data Source ConfigurationIf the MongoDB port is the default port
Tag: Create database close. exe path width http color BPAAfter installation, enter CMD. Go to the Bin directory under the installation directory.Choose an empty directory and create a Db,log folder. After the terminal command line, enter a return.D:\
1. Download Mongodb-win32-x86_64-2008plus-ssl-v3.6-latest extract toD:\mongodb2.cmd = Does the path have an environment variable if not configured3. Create D:\mongodb\data\db and D:\mongodb\logs\mongodb.log, D:\mongodb\ config\ mongod.cfgMongod.cfg
Recently the company to do a project to use MongoDB, below to introduce the Mongorepository interface.You can analogy Hibernate's jpa,mongorepository is a basic interface that a springdata provides for operations such as add-and-revise checks and
shell command vs. Mysql
Querying data
equals: Db.col.find ({"Delete_flag": "N"}). Pretty ()Less than: Db.col.find ({"Count": {$lt: Ten}}). Pretty ()Less than (lt:less than)Less than or equal (lte:less than or equal)Greater than
dbView the database for the current operation
show dbsShow all databases
show collectionsDisplays all collections under the current database
use database_nameConnect to a database named "database_name" and create if it does not exist
# mongod.conf#where to logLogpath=/opt/mongodb/mongod.logLogappend=true# fork and run in backgroundFork=trueport=27017maxconns=5000Quiet=truenssize=2047Dbpath=/mongo/replset/data#dbpath =/opt/mongodb/replset/dataProfile=0#slowms =100#smallfiles
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