mongodb 入门学习(索引-聚合)(四)总结

本文介绍了MongoDB中的索引和聚合操作。索引旨在提高查询效率,可以通过设置过期时间实现数据清理。聚合功能则包括不同类型的统计,如计数、按字段分组求和,以及使用管道命令进行复杂的数据处理。
摘要由CSDN通过智能技术生成

本篇主要学习索引和聚合,索引是为了加快查询速度,聚合是为了方便统计。

1 概述

 索引的目的就是为了打标签,快速的进行数据检索。在mongodb 中数据索引的存储

$tree
.
├── admin
│ ├── collection-11--5764503550749656746.wt
│ ├── collection-14--6907424972913303461.wt
│ ├── collection-16--6907424972913303461.wt
│ ├── collection-20--6907424972913303461.wt
│ ├── collection-8--6907424972913303461.wt
│ ├── collection-9--5764503550749656746.wt
│ ├── index-10--5764503550749656746.wt
│ ├── index-12--5764503550749656746.wt
│ ├── index-13--5764503550749656746.wt
│ ├── index-15--6907424972913303461.wt
│ ├── index-17--6907424972913303461.wt
│ └── index-9--6907424972913303461.wt
├── journal
│ ├── WiredTigerLog.0000000003
│ └── WiredTigerPreplog.0000000001
├── local
│ ├── collection-0--5764503550749656746.wt
│ ├── collection-2--5764503550749656746.wt
│ ├── collection-4--5764503550749656746.wt
│ ├── collection-6--5764503550749656746.wt
│ ├── collection-7--5764503550749656746.wt
│ ├── index-1--5764503550749656746.wt
│ ├── index-3--5764503550749656746.wt
│ ├── index-5--5764503550749656746.wt
│ └── index-8--5764503550749656746.wt
├── _mdb_catalog.wt
├── mongod.lock
├── products
│ ├── collection-6--6907424972913303461.wt
│ └── index-7--6907424972913303461.wt
├── sizeStorer.wt
├── storage.bson
├── WiredTiger
├── WiredTiger.basecfg
├── WiredTiger.lock
├── WiredTiger.turtle
└── WiredTiger.wt

_mdb_catalog.wt里存储了所有集合的元数据,包括集合对应的WT table名字,集合的创建选项,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值