【问题标题】:Can you create a compund index including _id or key?你能创建一个包含_id或key的复合索引吗?
【发布时间】:2021-10-03 09:27:46
【问题描述】:

假设我有以下文件:

{_id: "mycollection/key",
 _key: "key",
 users: ["userKeyA","userKeyB","userKeyC"]
}

我可以为 _idusers 创建一个持久索引以加快查找用户键的时间吗?

【问题讨论】:

    标签: indexing arangodb


    【解决方案1】:

    是的,你可以。

    db.<collection>.ensureIndex({fields:["users", "_key"], type:"persistent");
    

    【讨论】:

      猜你喜欢
      • 2013-07-22
      • 2019-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多