javascript - Mongodb对查找功能不区分大小写
问题描述
下面的代码是我如何为我的查找功能进行排序:
{
$lookup: {
from: 'members',
let: { abc: '$abc' },
pipeline: [
{
$match: { $expr: { $in: ['$_id', '$$abc'] } }
},
{ $sort: { name: 1 } }
],
as: 'cde'
}
}
现在我想让排序不区分大小写。我知道通常我们可以使用collation: { locale: 'en' }
. 但是如何将它添加到查找函数中呢?
解决方案
推荐阅读
- php - 在 PHP 中组合数据以插入 SQL 的最佳方法是什么?
- dm-script - DM 脚本计算具有给定 ROI 的曲线下面积
- c++ - 有没有办法在 VS 2019 中将 C++ 可执行文件与 DLL 合并?
- go - 有没有办法验证 git sha 是否属于带有 go-github 客户端的 git 分支?
- java - Onclick 监听器没有响应对 imageview 的点击
- javascript - React Antd 输入 url 验证
- react-native - 如何从底部选项卡导航器的每个选项卡访问抽屉?
- django - 在 Django 中生成用户唯一链接并存储购买点
- alpacajs - 如何在 Alpaca 的条件依赖项中使用 stringContains?
- javascript - 如何仅使用 ajax 和 jquery 设置 google oauth