Code Monkey home page Code Monkey logo

mmb's Introduction

mmb

mmb = moa mongodb backup, backup data to a dirname that generated by momentjs's date format

npm version

Install

[sudo] npm install -g mmb

Usages

mmb init

导出

mmb

导入(警告,此处会覆盖数据,请谨慎操作)

mmi 2015-08-23_23:09

授权

mmb --auth sang/0000

Config

when mmb init, this will create a mongo.config.json

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

版本历史

  • v1.1.0 实现mmi,按照日期导入,感谢 @DavidCai1993
  • v1.0.0 初始化版本,实现mmb导出

欢迎fork和反馈

如有建议或意见,请在issue提问或邮件

License

this repo is released under the MIT License.

mmb's People

Contributors

i5ting avatar davidcai1111 avatar

Stargazers

YuYuai avatar  avatar 阿汤哥 avatar Ruibin avatar Zida (Edward) avatar 施建方 avatar  avatar jipan avatar tmax avatar Jury Schon avatar  avatar

Watchers

James Cloos avatar  avatar Thomas Lau avatar GladiusK avatar 施建方 avatar WangAnbang avatar zxy avatar Liees_q avatar

mmb's Issues

sorry,this script requires mongoimport

ubuntu中redis经常过段时间就罢工,就把论坛迁移到了windows下,使用mmi 和mmb的时候不能运行,希望能够增加在windows环境下的功能。现在暂时先用mongodb import的功能先把csv导入进去。

mongoimport

有了备份,也需要有重新导入

mmi 其他和之前样,只需要指定时间即可

增加-u和-p授权参数

mongoexport --help
Usage:
mongoexport

Export data from MongoDB in CSV or JSON format.

See http://docs.mongodb.org/manual/reference/program/mongoexport/ for more information.

general options:
--help print usage
--version print the tool version and exit

verbosity options:
-v, --verbose more detailed log output (include multiple times for more verbosity, e.g. -vvvvv)
--quiet hide all log output

connection options:
-h, --host= mongodb host to connect to (setname/host1,host2 for replica sets)
--port= server port (can also use --host hostname:port)

authentication options:
-u, --username= username for authentication
-p, --password= password for authentication
--authenticationDatabase= database that holds the user's credentials
--authenticationMechanism= authentication mechanism to use

namespace options:
-d, --db= database to use
-c, --collection= collection to use

output options:
-f, --fields= comma separated list of field names (required for exporting CSV) e.g. -f "name,age"
--fieldFile= file with field names - 1 per line
--type= the output format, either json or csv (defaults to 'json')
-o, --out= output file; if not specified, stdout is used
--jsonArray output to a JSON array rather than one object per line
--pretty output JSON formatted to be human-readable

querying options:
-q, --query= query filter, as a JSON string, e.g., '{x:{$gt:1}}'
-k, --slaveOk allow secondary reads if available (default true)
--forceTableScan force a table scan (do not use $snapshot)
--skip= number of documents to skip
--limit= limit the number of documents to export
--sort= sort order, as a JSON string, e.g. '{x:1}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.