简体   繁体   English

mongoDB 中 concat firstName 和 lastName 中不区分大小写的搜索

[英]Case insensitive search in concat firstName and lastName in mongoDB

i want to search fullName by using firstName and lastName fields for that i am using below filter我想通过使用 firstName 和 lastName 字段来搜索 fullName 我在下面使用的过滤器

collections.find({$expr:{$eq:["test test", {$concat:["$firstName", ' ', "$lastName"]}]}})

But this need to be case insensitive filter.但这需要不区分大小写的过滤器。 Let me know if is there any way to do.让我知道是否有任何办法。

创建不区分大小写的索引: https : //docs.mongodb.com/manual/core/index-case-insensitive

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM