that Mongovue does not support MONGODB3 versions of MongoDB Common commands: View Databases
> show dbs
using databases
> use database-name
view tables
> Show tables
query data
> db.table-name.find ({})
query criteria
> Db.table-name.find ({ ' name ':'zhangsan'}) Build an index > Db.table-name.ensureindex ({' Name ': 1}) 1 is ascending,-1 is descending Composite Index > db.table-name.ensureind
Linux mongodb installation and data import and export tutorial, mongodb Import and Export
How to install mongodb and import and export data in Linux
# Viewing the linux release version
Cat/etc/issue
# View the Linux kernel version
MongoDB import, export, backup, recovery, user authorization (4), mongodb ImportV. MongoDB import, export, backup, recovery, and user authorizationI. Data export and Data ImportAs a DBA (Administrator), you often need to import an
JSON can only represent a subset of the types supported by BSON. To preserve type information, MongoDB adds the following extensions to the JSON format:
Strict mode. Strict mode representations of BSON types conform to the JSON RFC. Any JSON parser can parse th
JSON turn BsonMongoDB is stored in the Bson data format, the JSON string has no way to write directly to MongoDB can convert the JSON string into DBObject or document, and then write to MongoDB1. Convert the JSON character to Com.mongodb.DBObject (exactly basicdbobject) Scal
Tags: open cannot composite word Enter Workaround Method Field SupportSince the use of Microsoft visual graphical interface has been used, and MongoDB is a command-type operation, and the system with the CMD operation is not convenient, Here is a replacement of a cmd, the size of more than 100 m. Cmder Tool Download Https://github.com/cmderdev/cmder/releases The next operation is all done with the Cmder tool to perform the instruction Operation demo
Tags: MongoDB gap Build Library title BSD Mon init grep rubyMongodb 1.1 Software Introduction ? A product between a relational database and a non-relational database – a database based on distributed file storage. – written in the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications. –mongodb stores data as a document and data structures are composed of
[[emailprotected] mongodb]# mongorestore -d tank /home/zhangy/mongodb/tank/ #tank这个数据库的备份路径 [[emailprotected] mongodb]# mongorestore -d tank_new /home/zhangy/mongodb/tank/ #将tank还有tank_new数据库中
These two commands can be implemented to backup and restore the database, the file format is
Tags: god represents file HTML common category name cat stringZhang Ying published in 2013-12-03 Category list: NoSQL Tags: mongodb, backup, import, export, restore MongoDB data backup and restore is mainly divided into two kinds, one is for the library of Mongodump and Mongorestore, one is for the table in the library mongoexport and Mongoimport. One, Mongodump
,stdoutisused
--jsonArrayoutputtoajsonarrayratherthanoneobjectper
line
[root@localhostbin]#
The following is a practical example to illustrate the usage of this tool:
Export table t1 in the foo database to json format:
[root@localhostbin]#./mongoexport-dfoo-ct1-o/data/t1.json
connectedto:127.0.0.1
exported1records
[root@localhostbin]#
After the export is successful, check wheth
MongoDB basic (5) backup restoration and Export Import
The original snapshot of the operating system is used for Backup and restoration. After the Backup is successful, the restoration fails (see Backup and Restore with Filesystem Snapshots)
So this method is not recorded here.
Which of the following are currently tested? Backup restoration methods (for beginners ):
1. Copy and replace database files for ba
备份路径
3. Restore the specified database?
1 2 3
[[emailprotected] mongodb]# mongorestore -d tank /home/zhangy/mongodb/tank/ #tank这个数据库的备份路径 [[emailprotected] mongodb]# mongorestore -d tank_new /home/zhangy/mongodb/tank/ #将tank还有tank_new数据库中
These two commands can be implemen
After reading the introduction, we only know that the Mongodb data is in the file using json. But I still don't understand. who can help me compare what the relational databases correspond to in Mongodb. I know it is not a kind of thing, but if it is all about data storage, it can explain how mysql is stored and how Mongodb
format is JSON and Bson. Unable to refer to a table backup or restore.Four, Mongoexport export the table, or some fields in the table1, Common command formatMongoexport-h IP--port Port-u user name-p password-D database-C table name-F field-Q conditional export--csv-o file nameThe above parameters are good to understand, focus on:-F export refers to field, split by font size,-f name,email,age export name,email,age three fields-Q can export the root qu
These two commands enable the database to be backed up and restored, and the file format is JSON and Bson. Cannot point to write to table backup or restore.
Four, Mongoexport export tables, or some of the fields in the table
1, commonly used command format
Mongoexport-h IP--port Port-u username-p password-D database-C table name-F field-Q condition export--csv-o file name
The above parameter is good to understand, the key point
JSON string, e.g., ' {x:{$gt: 1} '-K,--slaveok allow secondary reads If available (default true)--forcetablescan force a table scan (does not use $snapshot)--skip= Number of documents to skip--limit= limit the number of documents to Expor T--sort= sort order, as a JSON string, e.g. ' {x:1} '3.2 mongoimport import #列 "_id" will also be impo
Mongodb provides easy-to-use export and import commands.
1. Introduction and use of export commands.
MongoDB provides a simple export tool, which is located in {MongoDB_HOME}/bin/mongoexport.exe, for example (My mongodb is deployed in a windows operating system and is similar in linux ):
The following describes how to
)--journal enable journaling (relevant only ifDBPath specified)-d [--DB] arg database to use-c [--collection] arg collection to use (some commands)-O [--out] arg (=dump) output directory or "-" for stdout-Q [--query] arg JSON query--oplog use Oplog for Point-in-timeSnapshotting--repair try to recover a crashed database--forcetablescan Force a table scan$snapshot)Export Database[Email protected] ~]# mongodump-h 127.0.0.1--port 30216-d test-uxxxx-pxxxxx
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.