【发布时间】:2015-03-02 14:58:43
【问题描述】:
我正在尝试使用 OrientDB 1.7.10 附带的 BaasBox v0.9.2 来构建我想要构建的概念验证网络应用程序。前提相当简单,添加/查询对于单个集合来说非常直接和简单。我难以想象的是如何在 NoSQL 中获取统计类型信息。
例如,我有一组联系人(名字、姓氏、地址等)和一组活动(标题、日期、时间等),每个活动都有一组参与者。
对象看起来像这样:
联系方式
{
"firstName": "John",
"lastName": "Doe",
"appId": "64f00bcb-cc04-4ed9-89fc-3b9b1a448dae"
}
活动
{
"title": "Some Event",
"eventDate": "2015-02-24 04:46 PM",
"isoDate": "2015-02-24T20:46:00.000Z",
"appId": "64f00bcb-cc04-4ed9-89fc-3b9b1a448dae",
"attendees": [
{"contactId": "c8ae2767-5fe5-4d41-ad6a-b10bd6e62f03", "attended": true},
{"contactId": "eacff8ff-b691-4d82-9429-898a097ea43a", "attended": true},
{"contactId": "70ab166c-c0a0-488a-9d5f-6f0b70a32125", "attended": false},
{"contactId": "34944c69-ebdb-49c6-bd1b-cdb0d191f124", "attended": true},
{"contactId": "8907e99e-96d6-46e9-a76f-1f9ce7f760d3", "attended": true}
]
}
我想知道的是:
John Doe 参加的最后一次活动是什么? John Doe 错过了多少活动?
我更喜欢使用 Baasbox JS-SDK 的示例,但 Plugin-API 也是可以接受的,因为没有什么是一成不变的。
【问题讨论】: