MongoDB provides backup and restore capabilities, Mongodump.exe and Mongorestore.exe files in the MongoDB download directory, respectively.1. Back up your data using the following command:>mongodump-h dbhost-d Dbname-o dbdirectory-H:MONGDB the server address, for example: 127.0.0.1, you can also specify the port number: 127.0.0.1:27017-D: The database instance that needs to be backed up, for example: test-O
Mongodump and mongorestore are two commands used to back up and recover mongodb databases. They are located in the bin folder of the mongodb installation directory. The backup file exported by mongodump is in binary format. Each file has two backup files, file name. bson and file name. metadata. json. Let's take a look at the example of mongodump.
Mongodump and mongores
MongoDB service with IP 127.0.0.1 port number 27017 and backs up all data to the bin/dump/directory. The command output results are as follows:The list of optional parameters for the Mongodump command is as follows:
Grammar
Description
Example
Mongodump--host host_name--port port_number
This command will back up all MONGODB data
Mongodump--host w3cschool.cc--port 27017
Mongodump--dbpat
Tags: nbsp technology share Text name Mongod technology fill make time The another tool is mentioned in this blog, namely Mongodump and Mongorestore. General speaking, it's very useful to back up or to restore the data of the database or collection by means of Mongodump and MOngorestore. In the next time, we'll make some examples about mongodump and mongorestore
backs up all data to the bin/dump/directory. The command output results are as follows:
The list of optional parameters for the Mongodump command is as follows:
Grammar
Description
Example
Mongodump--host host_name--port port_number
This command will back up all MONGODB data
Mongodump--host runoob.com--port 27017
Mongodump--dbpath Db_path--out backup_directory
Mongodump--dbpath/data/db/--
Tag: OOB file Data cal Objectid Error:god exists backup fileBackup:Mongodump-h localhost:27017-d test-o "D:\DATA\DB1"To restore a backup:D:\mongodb\bin>mongorestore-h localhost:27017-d test--drop "D:\data\db1\test"If you do not add--drop you will be prompted with errorserror:e11000 duplicate key error index:test.runoob.$_id_ dup key: {: ObjectId (' 5b076926d2476498526a9d3b ')}Hint that there is data in the previous database that is identical to the _i
No matter how much you think about it, backup of the data is always necessary, especially important data. MongoDB also provides backup and recovery capabilities, respectively, Mongdump.exe and Mongorestore.exe files in the MongoDB download directory. first introduce the following command syntax: > Mongodump - H Dbhost - D dbname - o dbdirectory -H:MONGDB the server address, for example: 127.0.0.1, you can also specify the port number: 127.0.0.1:27017
to:localhost
2016-05-31t20:11:29.003+0800 Imported Documents
Data backup Mongodump
Parameter description:
-D database name-C Collection NameFile path for-o backup
More parameter descriptions can refer to Mongodump–help
Example: Back up the TestDB user to/tmp
mongodump-d testdb-c user-o/tmp
2016-05-31t20:18:25.813+0800 writing Testdb.user to/tmp/testdb/user.bson
Data Recovery Mongorestore
Python decorator use example and actual application example, python example
Test 1
Deco is running, but myfunc is not running
Copy codeThe Code is as follows:Def deco (func ):Print 'before func'Return func
Def myfunc ():Print 'myfunc () called'Myfunc = deco (myfunc)
Test 2
Call myfunc in the required deco to executeCopy codeThe Code is as follows:Def deco (func
/*======================================================================
A Globalmem Driver As an example of char device drivers
There are two same globalmems in this driver
This example was to introduce the function of File->private_data
The initial developer of the original code is Baohua Song
======================================================================*/
#include #include #include #include #in
Example analysis of credit rating model (taking consumer finance as an example)original 2016-10-13 Canlanya General Assembly data Click "Asia-General data" to follow us!the fifth chapter analysis and treatment of self-variableThere are two types of model variables, namely, continuous type variables. A continuous variable refers to the actual value of the variable as observed data, and is not processed by a
Remember when a friend wanted his VFP program to run this way: There is no VFP main screen (_screen), the runtime directly on the desktop, a login dialog box, enter the user name and password and verify the software after the main interface, looks like the software written in VB, a very cool feeling.
The main interface of VFP software can usually be implemented in two ways: the main screen (_screen) or the top-level form (or the parent-child form). You can use the top level form to implement th
ElasticSearch configuration example and elasticsearch example
##################### ElasticSearch configuration example ################ #####
# This file contains an overview of various configuration settings,# Targeted at operations staff. Application developers shoshould# Consult the guide.# This file contains an overview of various configurations. It is desig
Classic array example and classic array example
Example 1: average score of Students
1 public static void main (String [] args) {2 inputs input = new inputs (System. in); 4 int scores [] = new int [5]; 5 int sum = 0; 6 7 System. out. println ("Enter the score of five students:"); 8 for (int I = 0; I
Example 2: output
Python combination mode and responsibility chain mode programming example, python example
Combination ModeWe regard the Composite mode as a complex attribute structure. In fact, there are basically three roles: trunk (defining some operations for leaf) and branches (many branches on the trunk) and the leaf (the object that the trunk wants to operate on), the Composite mode helps us implement: that is, they
This example applies to the knowledge of the Between...and clause in the SELECT statement, referring to the SELECT statement: Select SQL command or the SQL language tutorial.
This example runs the following diagram:
This example uses the "Data 1" database "People information table", about the database is already looking at the case of VFP: sample database is
SQL Injection principle and solution code example, SQL example
1. What is SQL injection?
1. What is SQL injection?
SQL injection is to insert SQL commands into Web forms to submit or input query strings for domain names or page requests, and finally fool the server to execute malicious SQL commands, for example, most of the previous VIP member passwords leaked by
The basic usage example of the Yii Framework of PHP, and the yii Framework example. The basic usage example of the Yii Framework in PHP. the yii Framework example shows CGridView in the automatically generated Yii code on the admin interface. This is a basic example of Yii F
PHP implementation of simple syntax highlighting function example analysis, highlighting case analysis
In this paper, a simple syntax highlighting function for PHP implementation is described. Share to everyone for your reference. The specific analysis is as follows:
This is a PHP implementation of a simple syntax highlighting function, Note: This function design is relatively simple, may not highlight some of the syntax, you can expand the function
Android client-server interaction login example, android example
Today, I learned how the android client interacts with the server, and found that it is actually a bit similar to the web. Then I found a logon example on the Internet based on IntentService.
1. Simple servlet is used in the background, and GET or POST is supported. The servlet returns a flag strin
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.