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'}}}])

相关推荐
文牧之1 分钟前
PostgreSQL 常用日志
运维·数据库·postgresql
TE-茶叶蛋26 分钟前
Redis 原子操作
数据库·redis·缓存
Linux运维老纪29 分钟前
Python文件操作及数据库交互(Python File Manipulation and Database Interaction)
linux·服务器·数据库·python·云计算·运维开发
Bruce_Liuxiaowei35 分钟前
MCP Python SDK构建的**SQLite浏览器**的完整操作指南
数据库·python·sqlite
数据与人工智能律师1 小时前
正确应对监管部门的数据安全审查
大数据·网络·数据库·人工智能·区块链
2401_897930061 小时前
什么是非关系型数据库
数据库·oracle
鱼丸丶粗面1 小时前
Python 读取 txt 文件详解 with ... open()
linux·数据库·python
拾荒者.1261 小时前
设计一个关键字统计程序:利用HashMap存储关键字统计信息,对用户输入的关键字进行个数统计。
数据库·python·mysql
encoding-console1 小时前
欧拉环境(openEuler 22.03 LTS SP3)安装移动磐维数据库(PanWeiDB_V2.0-S2.0.2_B01)步骤
数据库·虚拟机·欧拉·磐维数据库
辰哥单片机设计2 小时前
PTC加热片详解(STM32)
数据库·mongodb