问题描述
我尝试使用以下代码在所有文本字段中通过字符串搜索来查找文档:
var collection = this.MongoDatabase.GetCollection<myEntity>(collectionName);
var index= new CreateIndexModel<myEntity>(Builders<myEntity>.IndexKeys.Text("$**"));
collection.Indexes.CreateOne(index);
Builders<myEntity>.Filter.Text(mySearchString)
如果我有一个包含 MyImportantContent
的文档,它将匹配我的搜索 myimportantcontent,但不匹配 myimporta。
那么如何匹配像 myimporta 这样的子字符串?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)