
mongoexport -u root --authenticationDatabase=admin -d c***prod -c Vr***foDO --type=csv -f contentId,to**me,createdTim,t**idDa -q '{$and:[{ $or: [ {contentId:{ $regex:/^6009266/}}, {contentId:{ $regex:/^6009261/}} ]} ,{createdTime : {$gte : new Date(1610553655000)}} ]}' -o home/mongo/t**id_20220210.csv



Extend JSON包含规范扩展JSON和宽松扩展JSON两种格式,但是不论哪种格式,JSON文档中的所有字符串都应有双引号,而Mongodb的增删改查的格式也是个json,所以也应用双引号包起来。 在规范的扩展JSON中,每一个数值都必须包含其字段类型,如时间数据必须是{"$date": {"$numberLong": "1610553655000"}},长整型数据 {"$numberLong": 50}。
{"$and":[{ "$or": [ {"contentId":{ "$regex":"^6009266"}}, {"contentId":{ "$regex":"^6009261"}} ]},{"createdTime" : {"$gte" : {"$date": {"$numberLong": "1610553655000"}}}} ]}

END
本文作者:刘运彬
本文来源:IT那活儿(上海新炬王翦团队)
文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。