0

我希望计算 JSON 流具有 status='active' 的成员。这将等于我们成员的总和。

我可以通过 选择所有成员@/name,但我不能只过滤那些活跃的成员。

根据Klipfolios 文档,应该可以计算单个元素:在此处输入图像描述

[
    {
        "_id": "58aabc92e846502357fc0f69",
        "email": "mail@me.com",
        "name": "John Doe",
        "office": "1122",
        "phone": "555-555",
        "status": "active",
    },
    {
        "_id": "58aabc92e846502357fc0f69",
        "email": "mail@me.com",
        "name": "John Doe",
        "office": "1122",
        "phone": "555-555",
        "status": "active",
    },
    {
        "_id": "58aabc92e846502357fc0f69",
        "email": "mail@me.com",
        "name": "John Doe",
        "office": "1122",
        "phone": "555-555",
    },
    {
        "_id": "58aabc92e846502357fc0f69",
        "email": "mail@me.com",
        "name": "John Doe",
        "office": "1122",
        "phone": "555-555",
    }
]
4

2 回答 2

0

COUNT(@/name;)计算 JSON 流中所有出现的名称。我如何只计算活跃会员?例如。其中状态 = '活动'

于 2017-05-05T08:05:13.203 回答
0

这个怎么样?

COUNT(@/name[status='active'];)

于 2017-05-05T17:20:01.167 回答