mongodb三种去重方式

这里补充用mongodb去重的3种方式:

1、db.info_store_dynamic_info.distinct("store_id",{"time_type":2});

2、db.runCommand({"distinct":"info_store_dynamic_info","key":"store_id","time_type":2});

3、

db.getCollection('info_store_daily_info').aggregate({$group:{'_id':{'store_id':'$store_id','is_push':'$is_push'}}})

相关推荐
IT枫斗者枫哥6 小时前
MyBatis一对多分页:LIMIT 20,为什么凑不齐20个订单?
java·数据库
Y006 小时前
PostgreSQL 的锁:为什么你的 ALTER TABLE 会卡住,以及怎么查
数据库·postgresql
灰原喜欢柯南6 小时前
OceanBase 运维管理知识点——OCP 监控、诊断与变更控制
数据库·oceanbase
码农-0046 小时前
Springboot 集成 Ehcache操作数据库显示SQL语句设置
数据库·spring boot·sql
仍然.6 小时前
Redis---事务
数据库·redis
oradh6 小时前
Oracle 执行计划的阅读方法(二叉树结构来理解和阅读)
数据库·oracle·执行计划的阅读方法
SelectDB6 小时前
Doris 向量检索上线踩坑记录:七个排查现场与可直接复制的命令
大数据·数据库·数据分析
数据库小学妹6 小时前
MySQL深分页优化:LIMIT大偏移的根因分析与五种解法对比
数据库·mysql·性能优化
SelectDB6 小时前
一条大查询把集群打挂之后:Apache Doris 稳定性处置与资源隔离速查
大数据·数据库·数据分析