当前位置:网站首页>使用bat脚本以json格式导出mongo数据库中指定表数据
使用bat脚本以json格式导出mongo数据库中指定表数据
2022-07-30 13:55:00 【nSponge】
问题:
使用bat脚本以json格式导出mongo数据库中指定表数据,简单记录一下。
解决:
@echo on
set mongo_bin=D:/MongoDB/Server/4.2/bin
set db=A2DB_S_PID
set tableStand=_Standard_List
set table=_S_10b450c8-325b-43ba-8a1d-623d9bedbb82
set ip=10.0.0.16
set port=27700
set /a port1=%port%+1
set /a port2=%port%+2
set username=admin
set password=5382DF4748760FA5ABD91213B1EF4621E7DD8002333121170912B42922823FEE
set outPath=D:/A2DB_S_PID
cd /d %mongo_bin%
mongoexport --host "A2DB/%ip%:%port%,%ip%:%port1%,%ip%:%port2%" --authenticationDatabase admin -u %username% -p %password% --collection %tableStand% --db %db% --out %outPath%/%tableStand%.json
mongoexport --host "A2DB/%ip%:%port%,%ip%:%port1%,%ip%:%port2%" --authenticationDatabase admin -u %username% -p %password% --collection %table% --db %db% --out %outPath%/%table%.json
echo OK!!!
边栏推荐
猜你喜欢

LeetCode二叉树系列——144.二叉树的最大深度

关于容器的小案例

LeetCode二叉树系列——515.最每个树行中找最大值

跳槽前,把自己弄成卷王
SQL 26 calculation under 25 years of age or older and the number of users

ECCV 2022 | 通往数据高效的Transformer目标检测器

The path to uniting the programmer: "titles bucket" to the highest state of pragmatic

Conversion between pytorch and keras (the code takes LeNet-5 as an example)

Application of time series database in the field of ship risk management

六面蚂蚁金服,抗住面试官的狂轰乱炸,前来面试复盘
随机推荐
网站添加能换装可互动的live 2d看板娘
高性能数据访问中间件 OBProxy(三):问题排查和服务运维
ccs软件的使用(靠谱挣钱的app软件)
3 years of software testing experience, the interview requires a monthly salary of 22K, obviously he has memorized a lot of interview questions...
Why do software testing have to learn automation?Talk about the value of automated testing in my eyes
MQTT网关读取西门子PLC数据传输到阿里云平台案例教程
Teach you how to write an eye-catching software testing resume, if you don't receive an interview invitation, I will lose
Jenkins自动化部署项目
Allure进阶-动态生成报告内容
容器排序案例
CF1677E Tokitsukaze and Beautiful Subsegments
【Advanced Mathematics】【7】Double Integral
Application of time series database in the field of ship risk management
权威推荐!腾讯安全DDoS边缘安全产品获国际研究机构Omdia认可
时间序列的数据分析(四):STL分解
CF603E Pastoral Oddities
无代码开发平台应用可见权限设置入门教程
八年测试经验,为何惨遭领导痛批:你写的测试文档还不如刚来的应届生
sql中ddl和dml(sql与access的区别)
How awesome is the "12306" architecture?