mongodb - 猫鼬慢速选择不在模型中的特定字段
问题描述
当我使用 Mongoose Paginate 插件选择一些不在 Mongoose 模型中的字段 (b) 时
const transactionData = await TransactionModel.paginate(condition, {
select: "a b c d e f g",
sort: {createdDate: -1},
lean: true,
page: page,
limit: limit,
populate: {
path: 'memberId',
select: '_id username'
}
})
查询时很慢。然后我尝试删除 [b] 字段。它似乎比上一个更快。我需要知道为什么。
解决方案
推荐阅读
- kubernetes - Kubernetes 1.17 containerd 1.2.0 与 Calico CNI 节点未加入主节点
- html - 在html中强制换行和圆角
- c# - Azure 函数类库的 .NET Core 3.1 传递参考问题
- javascript - 仅在 google 身份验证回调后运行保存用户功能
- wordpress - 为什么将 SSL 添加到网站时我会发现不同的内容
- python - 从多个 Docker 容器返回到本地主机的 Python 日志记录
- c - 关于在 c 中使用 fgets 和 scanf 读取输入的问题
- python - Music21:为乐谱中的所有和弦获取罗马数字,考虑到键的变化和未指定的键
- javascript - 在 window.onload 事件中不能做任何事情
- excel - 是否可以在 IF 公式或 Countif 公式中将 2 个数组连接在一起