为什么某些命令在mongodb currentOp中缺少'appName'?

Rah*_*hul 2 mongodb php-mongodb

我为我的一些项目应用了appName,但在currentOp中,某些查询缺少它.大多数情况下,计数查询都缺少它.

{
        "desc" : "conn1786739",
        "threadId" : "140671499200256",
        "connectionId" : 1786739,
        "client" : "179.22.4.3:42354",
        "active" : true,
        "opid" : -1076773120,
        "secs_running" : 6,
        "microsecs_running" : NumberLong(6928801),
        "op" : "command",
        "ns" : "dbname.members",
        "query" : {
            "count" : "memebers",
            "query" : {
                "$or" : [
                    {
                        "$and" : [
                            {
                                "condition1" : {
                                    "$gt" : 0
                                }
                            },
                            {
                                "condition1" : 0
                            },

                        ]
                    }
                ],

            },
            "readConcern" : {

            }
        },
        "numYields" : 28,
        "locks" : {
            "Global" : "r",
            "Database" : "r",
            "Collection" : "r"
        },
        "waitingForLock" : false,
    }
Run Code Online (Sandbox Code Playgroud)

我在currentOp中看到了上面的结果,甚至appName被设置为查询它没有出现在某些查询中.

sim*_*gix 5

这是4.0版中的新增功能,您必须在连接字符串中包含appName.请参阅在线文档.