MongoDB查询从条件返回错误结果

时间:2019-06-03 16:52:58

标签: mongodb nosql

我的查询似乎正确,并且我尝试了该查询的变体但结果不正确:

db.productpushes.find({
    "listOfBuyers.creditClaim": false}
}, { ASIN: 1, "listOfBuyers.invoice": 1, "listOfBuyers.creditClaim": 1 }).sort({ dateOfLaunch:-1 })

结果显示creditClaim的真实值:

/* 1 createdAt:5/31/2019, 3:52:19 PM*/
{
    "_id" : ObjectId("5cf185f35ee6c8029e0c3c25"),
    "listOfBuyers" : [
        {
            "invoice" : "",
            "creditClaim" : false
        }
    ],
    "ASIN" : "B07JFRBVQ7"
},

/* 2 createdAt:5/31/2019, 3:52:19 PM*/
{
    "_id" : ObjectId("5cf185f35ee6c8029e0c3c24"),
    "listOfBuyers" : [
        {
            "invoice" : "114-0707494-9814618",
            "creditClaim" : true
        },
        {
            "invoice" : "113-7151719-3060267",
            "creditClaim" : true
        },
        {
            "invoice" : "114-3639756-0399436",
            "creditClaim" : true
        },
        {
            "invoice" : "114-5221962-1412231",
            "creditClaim" : true
        },

语法错误吗?

0 个答案:

没有答案