当前位置:网站首页>使用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!!!
边栏推荐
猜你喜欢

“12306” 的架构到底有多牛逼

There is a risk of water ingress in the battery pack tray and there is a potential safety hazard. 52,928 Tang DMs are urgently recalled

记面试外包公司的一次经历,到底该不该去?

二手手机销量突破3亿部,与降价的iPhone夹击国产手机

手把手教你写让人眼前一亮的软件测试简历,收不到面试邀请算我输

Huawei's 7-year-experienced software testing director, gives some advice to all friends who want to change careers to learn software testing

无代码开发平台全部应用设置入门教程
SQL 26 calculation under 25 years of age or older and the number of users

VLAN实验

如何在 TiDB Cloud 上使用 Databricks 进行数据分析 | TiDB Cloud 使用指南
随机推荐
5. DOM
00后测试员摸爬滚打近一年,为是否要转行或去学软件测试的学弟们总结出了以下走心建议
网络安全——lcx的使用
新时代背景下智慧城市的建设与5G技术有何关联
【Advanced Mathematics】【7】Double Integral
二手手机销量突破3亿部,与降价的iPhone夹击国产手机
[ARC092B] Two Sequences
The way of programmers' cultivation: do one's own responsibilities, be clear in reality - lead to the highest realm of pragmatism
Flask Framework - Sijax
Redis6.0 source code learning (5) ziplist
UPC2022 Summer Individual Training Game 19 (B, P)
pytorch学习记录(六):循环神经网络 RNN & LSTM
华为7年经验的软件测试总监,给所有想转行学软件测试的朋友几点建议
重保特辑|拦截99%恶意流量,揭秘WAF攻防演练最佳实践
(HR Interview) Most Common Interview Questions and Skilled Answers
The use of ccs software (app software that makes money reliably)
CF780G Andryusha and Nervous Barriers
selenium4+pyetsst+allure+pom进行自动化测试框架的最新设计
CF1320E Treeland and Viruses
3 years of software testing experience, the interview requires a monthly salary of 22K, obviously he has memorized a lot of interview questions...