Commit 6ec160ef authored by Romain Courteaud's avatar Romain Courteaud

QueryStorage: documents do not have an _id property anymore

parent c408d263
...@@ -156,10 +156,11 @@ ...@@ -156,10 +156,11 @@
if (is_manual_query_needed) { if (is_manual_query_needed) {
len = result.length; len = result.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
result[i].doc.__id = result[i].id;
data_rows.push(result[i].doc); data_rows.push(result[i].doc);
} }
if (options.select_list) { if (options.select_list) {
options.select_list.push("_id"); options.select_list.push("__id");
} }
result = jIO.QueryFactory.create(options.query || "", result = jIO.QueryFactory.create(options.query || "",
context._key_schema). context._key_schema).
...@@ -178,13 +179,13 @@ ...@@ -178,13 +179,13 @@
len = result.length; len = result.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
element = { element = {
id: result[i]._id, id: result[i].__id,
value: options.select_list ? result[i] : {}, value: options.select_list ? result[i] : {},
doc: {} doc: {}
}; };
if (options.select_list) { if (options.select_list) {
// Does not work if user manually request _id // Does not work if user manually request __id
delete element.value._id; delete element.value.__id;
} }
if (options.include_docs) { if (options.include_docs) {
// XXX To implement // XXX To implement
......
...@@ -764,7 +764,6 @@ ...@@ -764,7 +764,6 @@
doc: { doc: {
title: "foo", title: "foo",
id: "ID foo", id: "ID foo",
_id: "foo",
another: "property" another: "property"
} }
}, { }, {
...@@ -773,7 +772,6 @@ ...@@ -773,7 +772,6 @@
doc: { doc: {
title: "bar", title: "bar",
id: "ID bar", id: "ID bar",
_id: "bar",
another: "property" another: "property"
} }
}]; }];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment