我想通过使用以下命令来使用来自不同索引类型(2dsphere 和文本)的两个索引:
db.mycoll.createIndex({"@geolocationable":"2dsphere",name:"text"})
但我收到以下错误:
"errmsg" : "bad index key pattern { @geolocationable: \"2dsphere\", name: \"text\" }: 一个索引不能使用多个索引插件。"
我阅读了MongoDB 文本和 2D 复合索引 ,但我不确定为什么我不能在一个集合中创建 2dsphere 和文本索引。
我并不是说我想在一个查询中使用两个索引,而我想创建这个索引以便在单独的查询中单独使用它们