zoukankan      html  css  js  c++  java
  • [Database] MongoDB (5) mongodump and mongorestore

    mongodb mongodump and mongorestore

    abeen@localhost:/program/mongodb-1.4/bin$ mongodump --help
    options:
      --help                   produce help message
      -h [ --host ] arg        mongo host to connect to
      -d [ --db ] arg          database to use
      -c [ --collection ] arg  collection to use (some commands)
      -u [ --username ] arg    username
      -p [ --password ] arg    password
      --dbpath arg             directly access mongod data files in this path,
                               instead of connecting to a mongod instance
      -v [ --verbose ]         be more verbose (include multiple times for more
                               verbosity e.g. -vvvvv)
      -o [ --out ] arg (=dump) output directory

    Example:

      1 #!/bin/sh
      2
      3 rm -rf /home/abeen/z_abeen_back/database_back/*
      4 cd /program/mongodb-1.4/bin
      5 ./mongodump -h 192.168.1.3 -d test -o /home/abeen/z_abeen_back/database_back
      6 exit 0


    abeen@localhost:/program/mongodb-1.4/bin$ mongorestore --help
    usage: /usr/lib/mongodb/mongorestore [options] [directory or filename to restore from]
    options:
      --help                  produce help message
      -h [ --host ] arg       mongo host to connect to
      -d [ --db ] arg         database to use
      -c [ --collection ] arg collection to use (some commands)
      -u [ --username ] arg   username
      -p [ --password ] arg   password
      --dbpath arg            directly access mongod data files in this path,
                              instead of connecting to a mongod instance
      -v [ --verbose ]        be more verbose (include multiple times for more
                              verbosity e.g. -vvvvv)

    Example:
     mongorestore -h 92.168.1.3 --directoryperdb /home/abeen/z_abeen_back/database_back/test       

  • 相关阅读:
    C#获取当前程序运行路径的方法集合
    SQL为查询的结果加上序号(ROW_NUMBER) 合并多个查询结果
    Asp.net导出excel时长数字被科学计数法的解决方案。(身份证长数字作为字符处理)
    Stopwatch的用法
    对web.config的ConnectionString加密
    如何检索数据库中的空值和null
    如何将闲置的平板作为第二显示器(分屏)使用
    pyinstaller 打包文件太大
    如何让openssl生成的SSL证书被浏览器认可
    还是那该死的IE~~~
  • 原文地址:https://www.cnblogs.com/abeen/p/2085185.html
Copyright © 2011-2022 走看看