mongodb 导出制定的查询结果
2024-08-31 09:08:05
1、mongo查询语句:
db.quarkContext.find({"submitTime":{"$gt":ISODate("2019-07-13T00:00:00.000+08:00")},"rawResult":{$regex:/\"ok\":0/}},{"info.sId":1,"submitTime":1,"responseTime":1})
2、编写导出查询语句文件quary.js
db.quarkContext.find({"submitTime":{"$gt":ISODate("2019-07-13T00:00:00.000+08:00")},"rawResult":{$regex:/\"ok\":0/}},{"info.sId":1,"submitTime":1,"responseTime":1}).forEach(
function(document) {
print(document.info.sId + "," + document.submitTime + "," + document.responseTime);
}
)
3、执行语句
./mongo 127.0.0.1:40000/shtel /data/service/mongodb/bin/query.js > /data/service/mongodb/bin/result.csv
query.js:查询条件及输入指令
result.csv:输出结果文件
最新文章
- [转]Linux常用命令
- SharePoint中使用C#跳转页面的研究
- android 解析XML 工具类
- ASP.NET MVC删除数据
- netstat__stat
- 基于QT的换肤整体解决方案(QSkinStyle)(提供Linux的XP风格)
- python编程语言 函数的形参
- 【HDOJ】2896 病毒侵袭
- 4种CSS3效果(360度旋转、旋转放大、放大、移动)
- 【原创】Kafka 0.11消息设计
- 解析FAT16文件系统
- jq 抽奖转盘
- 有关uploadifive的使用经验(转:http://www.cnblogs.com/itBscs/p/4781786.html )
- 说说不知道的Golang中参数传递
- ASP.NET MVC中,动态处理页面静态化
- Introducing Outflux: a smart way out of InfluxDB
- class example of C++
- java代码示例(6-4)
- Atitit  项目界面h5化静态html化计划---vue.js 把ajax获取到的数据 绑定到表格控件 v2 r33.docx
- bzoj5118: Fib数列2(费马小定理+矩阵快速幂)
热门文章
- spring cloud 2.x版本 Gateway熔断、限流教程
- 大话设计模式Python实现-中介者模式
- python实现圣诞树
- webpack入门配置步骤详解
- onunload事件不触发的探索
- Linux war包部署jenkins
- C# Mutex to make sure only one unique application instance started
- C# .NET 使用 NPOI 生成 .xlsx 格式 Excel
- Java性能之synchronized锁的优化
- 完美解决linux下vim在终端不能用鼠标复制的问题