- 创建索引

- 单字段创建索引:

db.peoples.createIndex({article: "text"})

  

- 多字段创建索引:

db.peoples.createIndex( { chinaName: "text"  , article: "text" } )

 

- 全部字段创建索引:

db.peoples.createIndex({"$**" : "text"})

 

- 删除索引:

db.peoples.dropIndex("article_text")

 

- 根据索引进行全文搜索:$text: {$search: {...}}

  - 基本使用:

db.peoples.find({$text : {$search : 'util模块'}})

 

相关文章:

  • 2022-12-23
  • 2021-09-26
  • 2021-06-20
  • 2021-08-28
  • 2022-02-24
  • 2021-05-18
猜你喜欢
  • 2022-12-23
  • 2022-01-11
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案