Tags: style blog http os using IO ar for dataI am a mongodb installed in CentOS1. Download MongoDBCurl-o http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.3.tgz2. Unzip the downloaded documentTAR-ZXVF mongodb-linux-x86_64-2.6.3.tgz3. Installing MongoDBCp-r mongodb-linux-x86_64-2.6.3/*/usr/local/mongoStart Mon
Tags: Mon Common operations drop restore Comm Ash data MONGO endView all databases: > Show DBS;
Select a database: > Use ECommerce;
To view the current database status: > Db.stats ();
To view all the collections in the current database: > Show Collections;
To view the collection status: > DB. Toperatelog.stats (1024)
To view collection data: > DB. Toperatelog.find ()
To delete a data collection: > DB. Toperatelog.drop ()
To back up a database collection: #/usr/local/
Label:The project used to MongoDB, the basic is to use Robomongo to connect the server, do some of the lower permissions to delete and change the operation. Commands often forget to record some of the most frequently used commands for collections for easy querying: 1 , create a clustered collection (table)
- 5 - });
2 a Clustered collection (table) with th
After the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations.1. Enter Help to see the basic Operation command:Show DBS: Display database list Show Collections: Displays a collection in the current database (similar to a table in a relational database) show Users: Show user use ;: Toggles the current database, which and ms- 1}): Find the Foo collection in the current database, provi
Comparison between MongoDB and MySQL commands
Traditional relational databases are generally composed of three levels: database, table, and record. MongoDB is composedDatabase, collection, and document)Three layers. MongoDB has no concept of columns, rows, and links for tables in relational databases, which reflects th
Label:MongoDB is a very popular NoSQL database management system, officially: MongoDB, I installed in localhost is the Enterprise Server version, the default installation file directory is: C:\Program files\mongodb\server\3.2\bin, click Windows+r, enter cmd, start command Prompt, go to the installation directory Every time you open command prompt you need to enter the installation directory of
column Db.userInfo.find ({sex: {$exists: true}}). Count (); Equivalent to: SELECT COUNT (Sex) from userInfo; Indexes (indexes are created and reused before they can cause efficiency problems) 1. Create an index db.userInfo.ensureIndex ({name:1}); Db.userInfo.ensureIndex ({name:1, TS:-1}); 2. Querying all indexes of the current aggregation collection db.userInfo.getIndexes (); 3. View Total index record size db.userInfo.totalIndexSize (); 4. Read all index information for the current collection
Basic database commands common database commands 1. Help Command Prompt helpdb. help (); db. yourColl. help (); db. youColl. find (). help (); rs. help (); 2. Switch to create database useyourDB. When a set (table) is created, the current database is automatically created. 3. query all databases. 4. Delete
Basic database commands common database
Tags: int names error logging related SQL RDA input new is yourAfter the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations.Enter help to see the basic Operations Command:Show DBS: Display Database listShow Collections: Displays a collection in the current database (similar to a table in a relational database)Show Users: Show userUse Db.help (): Show database Operations Command with
1. Display Server Status: Db.serverstatus () 2. MongoDB can monitor data through profile to optimize it.
Check whether the profile function is currently turned on: Db.getprofilinglevel () returns level, value 0|1|2, meaning: 0 for off, 1 for slow command, 2 for all
Open profile function: Db.setprofilinglevel (level,slowms); #level等级. At level 1 o'clock, the slow command defaults to SLOWMS (unit ms)(that is, execution time is greater than
Tags: des style http color io using AR strong forAfter the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations.Enter help to see the basic Operations Command:Show DBS: Display Database listShow Collections: Displays a collection in the current database (similar to a table in a relational database)Show Users: Show userUse Db.help (): Show database Operations Command with a lot of comm
Tags: string new manual OPD update var boolean journal baseMongodb:nosql Database
Important indicator points in MongoDB
The three elements in MongoDB
Database
Collection
Document
The data store in MongoDB is stored in the form of Bson, and Bson is a binary json, so it looks like the recorded form
Getlasterror command
When writing data to a database, MongoDB does not wait for a response message by default. Use the getlasterror command to ensure that the operation has been correctly executed.
In many drivers, the getlasterror command is automatically called when you use the "Security" mode (set write concern) for saving and updating. But when this special getlasterror command is called, what actually happens. Here, we will introduce how it works
Common commands of MongoDB
First, install the database. You can use windows or linux, but linux is recommended. I use ubuntu12.04. you can download the database at the following URL, it is usually a 64-bit system. If you use a linux system, you can use the command line to install mongodb. I just use sudo apt-get install mongo
, the disadvantage is that the data inserted by the user during Mongodump operation may not be backed up.C. Fsync and lock Lock the database so that users can only use the Read feature, and then use method B to export and import data. The advantage does not need to stop the MONGO service, the disadvantage is that users cannot perform insert operations during database lock.D. Use Slavedb and use method C to lock the Slavedb, and then use method B to export and import the data. The advantage does
Label:MongoDB cluster deployment and cluster maintenance commands http://lipeng200819861126-126-com.iteye.com/blog/1919271 MongoDB Distributed cluster architecture and monitoring configuration http://freeze.blog.51cto.com/1846439/884925/ See the article: Seven, monitoring configuration : As early as the last year has appearedMongoDBand the Redis 's cacti template, which you can use to monitor your
Tags: common opd count () ... Rename using Age logs modMongoDB Common commands: After the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations. Show DBS: Display database list use
database name: Switch the current database, which is the same as the meaning of ms-sql insideShow Collections: Displays a collection in the current database (sim
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.