猫鼬Azure宇宙

时间:2018-02-27 01:12:20

标签: node.js mongodb express mongoose azure-cosmosdb

我在mongoDB上运行count查询。但是得到以下错误。

app.get('/doc/count', (req, res) => {
    doc.count(req.query).then((count) => {
        res.send({ count });
    }, (err) => {
        res.status(400).send(err);
    });
});

但是我收到以下错误。适用于当地的mongodb。

{
    "name": "MongoError",
    "message": "query in command must target a single shard key",
    "_t": "OKMongoResponse",
    "ok": 0,
    "code": 61,
    "errmsg": "query in command must target a single shard key",
    "$err": "query in command must target a single shard key"
    }

0 个答案:

没有答案
相关问题