MongoDB Common commands:Switching between DBS with use XxxdbThen the operation is only for XXXDB;Show DBS shows all databasesShow collections Display all collectionsMongoDB database is generally installed under USR
One. MongoDB CREATE database: Use commandMongoDB use database_name is used to create a database. The command creates a new database and returns the existing database if it does not exist.Grammar:The basic syntax for the use DATABASE statement is as
About MongoDB:MongoDB is a cross-platform, document-oriented database that enables high-performance, high-availability, and can be easily scaled.MongoDB is also a product between a non-relational database and a relational database, and is the most
MongoDBIt is a high-performance, open-source, non-pattern document-type database developed using C ++. It is a popular nosql database, in many scenarios, it can be used to replace traditional relational databases or key/value storage
What is a replication set?
A replica set (replica sets) is an additional copy of the data that is the process of synchronizing data across multiple servers, which provides redundancy and increases data availability, and enables recovery of
MongoDB CREATE database;The syntax format for MongoDB database creation is as follows:Use database_nameIf the database does not exist, create the database, or switch to the specified database.If you want to see all the databases, you can use the
MongoDB is a collection-oriented document database, unlike relational databases where tables, columns, rows, and MongoDB databases are composed of a series of documents. Here to introduce the concept of MongoDB and simple operation.
1, the
MongoDB Basic Commands
After the MongoDB is successfully started, you can then open a command line window to enter MONGO to perform some operations on the database.
Enter help to see basic operations commands:
Show DBS: Displaying a list of
1, add a useradminanydatabase user, this is a user can manage all users, similar to the Super Admin bar
#打开mongo Shell
[root@localhost]# MONGO
#添加超级管理账号
> Use admin #进入admin表
> Db.createuser (
{ User
: "myadmin",
pwd: "Secret",
MongoDB start multi-instance and MongoDB create Delete, backup, copy enable multi-instance creation data and log storage locations with sufficient single server resources# 数据存放位置[[email protected] ~] mkdir -p
Use the show DBS command to see what needs to be noted is that when you just created a database that is empty, show DBS does not see for example > Use mymongoswitched to db mymongo> dbmymongo> s How dbslocal 0.000GB I created Mymongo but because
Test environment: 192.168.1.55, stand-aloneData Volume: 40 million or so.Test: Db.repairedatabase EffectDb.compact effectGet information about the database by using the stats command:Db.stats () {"DB": "Test","Collections": 7, Number
Basic concepts:
1. Document --> corresponds to the row of the relational database, that is, a record. It is more powerful than the row functions of relational databases, and more like a specific object. The document is displayed in the form of a Map.
Because Mongodb is not a relational database file, in fact, it does not have the so-called ldquo in traditional relational databases; database rdquo; concept, but don't worry, when you
Because Mongodb is not a relational database file, in fact, it
Install mongodb in linux universal Binary Package, mongodblinuxMonfoDB is an open-source document database that provides common performance, high availability, and automatic scaling.
The record in MongoDB is a document, which is a structure
Mongodb entry-5 insertion is essential for each database to add, delete, modify, and query data. First, we will introduce add, that is, insert. To compare the four operations, insert is the simplest in mongodb. The insret command is used to insert
MongoDB official explanation of Security Verification:
Http://www.mongodb.org/display/DOCS/Security+and+Authentication
In MongoDB, Service Startup does not have permission verification by default. In terms of security, this is definitely not
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.