首页 > 解决方案 > 如何设置多个索引

问题描述

我想设置多个索引。与下面的示例相同,我通过划分属性设置了多个索引,但它不是有效的 json。请让我知道如何正确设置多个索引。

此链接上的示例。 https://hyperledger-fabric.readthedocs.io/en/release-1.4/couchdb_tutorial.html

{
  "index":{
    "fields":["owner"] // Names of the fields to be queried
  },
  "ddoc":"index1Doc", // (optional) Name of the design document inwhich the index will be created.
  "name":"index1",
  "type":"json"
}
{
  "index":{
    "fields":["owner", "color"] // Names of the fields to be queried
  },
  "ddoc":"index2Doc", // (optional) Name of the design document inwhich the index will be created.
  "name":"index2",
  "type":"json"
}
{
 "index":{
   "fields":["owner", "color", "size"] // Names of the fields to bequeried
 },
 "ddoc":"index3Doc", // (optional) Name of the design document inwhich the index will be created.
 "name":"index3",
 "type":"json"
}

标签: couchdbhyperledger-fabric

解决方案


推荐阅读