英文:
How to fetch distinct count from a MongoDB collection using Java code?
问题
这是我的 MongoDB 查询:
db.getCollection('xyz').distinct("uid", {
p_id: "abc",
action: "mno",
time_lo_res: {
$gt: new ISODate("2020-06-22T04:00:00") * 1,
$lt: new ISODate("2020-06-23T04:00:00") * 1
}
}).length
我应该如何在 Java 控制台应用程序中获取这个数量?
英文:
This is my MongoDB query:
db.getCollection('xyz').distinct("uid",{p_id:"abc",action:"mno",time_lo_res:{$gt:new ISODate("2020-06-22T04:00:00")*1 , $lt:new ISODate("2020-06-23T04:00:00")*1} }).length
How can I fetch this count in a Java console application
专注分享java语言的经验与见解,让所有开发者获益!
评论