Note that there are some explanatory texts on larger screens.

plurals
  1. POcouchbase startkey_docid and complex key
    text
    copied!<p>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. </p> <p>Just a couple questions around this</p> <ul> <li>Will startkey_docid work correctly with a complex key? (This apparently works for couchdb)</li> <li>If yes to the above, is the source of the issue the use of dateToArray(doc.created) in our view?</li> <li>Is this a bug? </li> </ul> <p>View:</p> <pre><code>function (doc, meta) { if(meta.type == "json" &amp;&amp; doc.type == "POST") { emit([doc.category, dateToArray(doc.created), doc.visibility], null); } } </code></pre> <p>Call:</p> <pre><code>?startkey=["auto",[2013,10,10,23,12,0],"EVERYONE"]&amp;endkey=["auto",[2013,12,11,23,12,0],"EVERYONE"]&amp;startkey_docid=a4a6cf44-8a82-494a-a2b9-f6a3ec629f17 </code></pre> <p>Result:</p> <pre><code>{ 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 }] } </code></pre> <p>Example data set. post_id is the document id.</p> <pre><code>{ type: "POST", post_id: "a4a6cf44-8a82", visibility: "EVERYONE", userID: "&lt;user_id&gt;", 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: "&lt;user_id&gt;", 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: "&lt;user_id&gt;", 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: "&lt;user_id&gt;", 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: "&lt;user_id&gt;", title: "Some title 5", category: "auto", description: "", created: "2013-11-12 17:41:07 -0800", modified: "2013-11-12 17:41:07 -0800" } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload