• [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       

  • 相关阅读:
    欢迎参加MVP主讲的Windows 10开发线上课程
    SharePoint 2013 重复的管理账户错误:已添加项。字典中的关键字 所添加的关键字
    SharePoint 2013 开发——SharePoint Designer 2013工作流
    SharePoint 2013 开发——构建工作流开发环境
    SharePoint 2013 开发——工作流架构
    SharePoint 2013 开发——APP安全模型
    SharePoint 2013 开发——SharePoint APP介绍
    SharePoint 2013 开发——概述
    win32
    hdu2100 26进制加法
  • 原文地址:https://www.cnblogs.com/abeen/p/2085185.html
Copyright © 2020-2023  润新知