一、概述
本篇博客为大家讲述一下Mongo DB是如何导入导出数据,还有就是备份数据的。
在下面操作的时候需要把Mongo DB的服务端打开才能操作。
二、导出。
MongoDB的导出非常简单打开cmd 输入下面命令
mongoexport -d foobar -c persons -o D:/persons.json
...
分类:
数据库 时间:
2015-04-28 18:32:01
阅读次数:
179
1.导出数据
mongoexport -d my_mongodb -c choice -o choice.dat
参数说明:
-d 指明使用的库, 本例中为” my_mongodb”
-c 指明要导出的表, 本例中为”choice ”
-o 指明要导出的文件名, 本例中为”choice .dat”
-h 服务器地址
2.导入数据
mongoi...
分类:
数据库 时间:
2015-03-12 19:16:52
阅读次数:
197
需求介绍:将mongodb中的数据以文件的方式导出:json或cvs格式mongo 提供了mongoexport的工具,可以实现将库中的数据以json或cvs的格式输出到文件中。mongoexport位于mongo安装位置中的bin/目录下。mongoexport具体用法如下所示:1. 使用help...
分类:
其他好文 时间:
2015-03-09 12:45:00
阅读次数:
197
mongodb的导入/导出/备份/还原1.mongoexport是mongo自带的数据导入工具,使用方法比较简单,以下是mongoexport常用的几个参数.[root@localhostadmin]#mongoexport--help-h[--host]#主机ip--port#端口-u[--username]#验证用户名-p[--password]#验证密码--authenticationDatabase#..
分类:
数据库 时间:
2015-02-02 19:58:19
阅读次数:
313
#count collectiondb.news.count({"lpublishtime":{"$gte":1358697600000}});#mongo导出mongoexport -h 192.168.1.175 --port 33000 -d booaa_so -c weibo -f '_i....
分类:
数据库 时间:
2014-11-07 12:52:58
阅读次数:
220
http://tuozixuan.iteye.com/blog/1321994实战代码:#mongo导出mongoexport --port 33001 -d bsdf_soe -c weibo -f '_id' -o 33001.bbs.ids#替换,将导出的文件内容替换成一个插入sql语句sed...
分类:
数据库 时间:
2014-11-07 12:36:52
阅读次数:
335
In the software development, we usually are faced with a common question of exporting or importing data from database. So in this blog we will together study the mongoddb export and mongodb import.
...
分类:
数据库 时间:
2014-10-28 02:07:13
阅读次数:
176
in last blog,we talked about how to export data from mongo database. now in this blog, on the contrary, we focus on how to import data to database.
before doing our experiment, we delete the user co...
分类:
数据库 时间:
2014-10-28 02:05:37
阅读次数:
252
数据导出 mongoexport 假设库里有一张user 表,里面有2 条记录,我们要将它导出 > use my_mongodb switched to db my_mongodb > db.user.find(); { "_id" : ObjectId("4f81a4a1779282ca68fd8a5a"), "uid" : 2, "u...
分类:
数据库 时间:
2014-10-10 13:37:04
阅读次数:
275
数据导出 mongoexport假设库里有一张user 表,里面有2 条记录,我们要将它导出> use my_mongodbswitched to db my_mongodb> db.user.find();{ "_id" : ObjectId("4f81a4a1779282ca68fd8a5a")...
分类:
数据库 时间:
2014-09-04 16:38:29
阅读次数:
272