The call below with the matching result set returns a result that does not start with the doc id a4a6cf44-8a82-494a-a2b9-f6a3ec629f17. As the result set below demonstrates the top 3 keys are identical, but startkey_docid has no effect.
Just a couple questions around this
- Will startkey_docid work correctly with a complex key? (This apparently works for couchdb)
- If yes to the above, is the source of the issue the use of dateToArray(doc.created) in our view?
- Is this a bug?
View:
function (doc, meta)
{
if(meta.type == "json" && doc.type == "POST")
{
emit([doc.category, dateToArray(doc.created), doc.visibility], null);
}
}
Call:
?startkey=["auto",[2013,10,10,23,12,0],"EVERYONE"]&endkey=["auto",[2013,12,11,23,12,0],"EVERYONE"]&startkey_docid=a4a6cf44-8a82-494a-a2b9-f6a3ec629f17
Result:
{
total_rows: 20,
rows: [{
id: "a4a6cf44-8a82",
key: ["auto", [2013, 11, 8, 1, 17, 46], "EVERYONE"],
value: null
}, {
id: "a4a6cf44-8a82-494a-a2b9",
key: ["auto", [2013, 11, 8, 1, 17, 46], "EVERYONE"],
value: null
}, {
id: "a4a6cf44-8a82-494a-a2b9-f6a3ec629f17",
key: ["auto", [2013, 11, 8, 1, 17, 46], "EVERYONE"],
value: null
}, {
id: "41070cfc-a85c-424c-9b87-fce0616c77c1",
key: ["auto", [
2013, 11, 11, 20, 28, 21], "EVERYONE"],
value: null
}, {
id: "bb275e3c-54da-4e85-8cc3-21defff4e278",
key: ["auto", [
2013, 11, 13, 1, 41, 7], "EVERYONE"],
value: null
}]
}
Example data set. post_id is the document id.
{
type: "POST",
post_id: "a4a6cf44-8a82",
visibility: "EVERYONE",
userID: "<user_id>",
title: "Some title 1",
category: "auto",
description: "",
created: "2013-11-07 17:17:46 -0800",
modified: "2013-11-07 17:17:46 -0800"
}, {
type: "POST",
post_id: "a4a6cf44-8a82-494a-a2b9",
visibility: "EVERYONE",
userID: "<user_id>",
title: "Some title 2",
category: "auto",
description: "",
created: "2013-11-07 17:17:46 -0800",
modified: "2013-11-07 17:17:46 -0800"
}, {
type: "POST",
post_id: "a4a6cf44-8a82-494a-a2b9-f6a3ec629f17",
visibility: "EVERYONE",
userID: "<user_id>",
title: "Some title 3",
category: "auto",
description: "",
created: "2013-11-07 17:17:46 -0800",
modified: "2013-11-07 17:17:46 -0800"
}, {
type: "POST",
post_id: "41070cfc-a85c-424c-9b87-fce0616c77c1",
visibility: "EVERYONE",
userID: "<user_id>",
title: "Some title 4",
category: "auto",
description: "",
created: "2013-11-11 12:28:21 -0800",
modified: "2013-11-11 12:28:21 -0800"
}, {
type: "POST",
post_id: "bb275e3c-54da-4e85-8cc3-21defff4e278",
visibility: "EVERYONE",
userID: "<user_id>",
title: "Some title 5",
category: "auto",
description: "",
created: "2013-11-12 17:41:07 -0800",
modified: "2013-11-12 17:41:07 -0800"
}