ArangoDB偏移在连接中不起作用

时间:2017-08-02 09:10:09

标签: arangodb

我有下表:users_categories,users。

users_categories对象包含"用户"只有键的字段,所以我加入:

FOR c IN users_categories
FILTER c._key == '75a65608-7e9b-4e74-be19-76882209e388'
FOR u IN c.users 
    FOR u2 IN users FILTER u == u2._key 
    LIMIT 0, 100
    RETURN u2

结果:

[
{
"_key": "5b1b68db-9848-4a0a-81b3-775007f16845",
"_id": "users/5b1b68db-9848-4a0a-81b3-775007f16845",
"_rev": "_VXo9gaC---",
"activated": true,
"blocked": false,
"citizenship": "RU",
"city": "Kalinigrad",
"deleted": false,
"email": "trigger.trigg@yandex.ru",
"lastActivityTime": 1501539830209,
"login": "triggerJK",
"name": "Max",
"passportId": "8736e8e4-9390-44e7-9e21-b17e18b1ebd9",
"phone": "89092132022",
"profileName": "Default profile",
"sex": 1,
"surname": "Max"
},
{
"_key": "0965a0d9-fc91-449f-90f8-9086944b1a86",
"_id": "users/0965a0d9-fc91-449f-90f8-9086944b1a86",
"_rev": "_VWjRYHe---",
"activated": true,
"blocked": false,
"citizenship": "AF",
"deleted": false,
"email": "megamozg4@mail.ru",
"lastActivityTime": 1501247531,
"login": "Megamozg4",
"passportId": "20ab7aad-d356-4437-86b2-6dfa9c4467e0",
"phone": "12312334555",
"profileName": "Default profile",
"sex": 1
}
]

如果我设置LIMIT 1或LIMIT 0,1只返回第一条记录,正如我想的那样。但是,如果我设置LIMIT 1,N(N可以是任意值)它返回空数组,那么偏移量不起作用吗?

我做错了什么?

ArangoDB使用:3.1.10

UPD: 不知何故,LIMIT 1,N不是唯一的第一个记录,而是前2个。 如果我要显示超过2条记录,则偏移工作很奇怪。我在github上创建了问题

1 个答案:

答案 0 :(得分:0)

报告了关于抵消的两个错误:

https://github.com/arangodb/arangodb/issues/2928 https://github.com/arangodb/arangodb/issues/2879

LIMIT的修补程序包含在版本v3.1.27和v3.2.1中,因此请更新并再次测试。