Indexing 不能';找不到分片密钥mongodb4.2的有效索引

Indexing 不能';找不到分片密钥mongodb4.2的有效索引,indexing,collections,sharding,Indexing,Collections,Sharding,mongodb 4.2的分片集群中存在问题。切分集合时,很明显存在索引且名称没有错误,但没有可用的索引“errmsg”:“找不到切分键的有效索引”,并且集合上没有数组索引。 这是索引: { "v" : 2, "key" : { "height" : "hashed" }, "name" : "height_hashed", "ns" : "filscan.msg", "background" : true } 这是创建语句: sh

mongodb 4.2的分片集群中存在问题。切分集合时,很明显存在索引且名称没有错误,但没有可用的索引“errmsg”:“找不到切分键的有效索引”,并且集合上没有数组索引。 这是索引:

{
    "v" : 2,
    "key" : {
        "height" : "hashed"
    },
    "name" : "height_hashed",
    "ns" : "filscan.msg",
    "background" : true
}
这是创建语句:
sh.shardCollection(“filscan.msg”,{“height”:“hashed”})
这是一个错误:

{
    "ok" : 0,
    "errmsg" : "couldn't find valid index for shard key",
    "code" : 96,
    "codeName" : "OperationFailed",
    "operationTime" : Timestamp(1580971229, 57),
    "$clusterTime" : {
        "clusterTime" : Timestamp(1580971229, 57),
        "signature" : {
            "hash" : 
BinData(0,"ZpHl5ZMJWxsEytfna7ZeKGJsPYI="),
            "keyId" : NumberLong("6779037467879145502")
        }
    }
}

我也有同样的问题。我已经在Mongo JIRA上开了一张票,但到目前为止没有回应。同样的问题。投了@GavinAiken的票。我也有同样的问题。我已经在Mongo JIRA上开了一张票,但到目前为止没有回应。同样的问题。投了@GavinAiken的票。