@xuda.io/xuda-dbs-plugin-xuda 1.0.99 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.js +1 -1
- package/studio.mjs +4 -4
package/package.json
CHANGED
package/server.js
CHANGED
@@ -926,7 +926,7 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
|
|
926
926
|
|
927
927
|
return { code: 1, data: body };
|
928
928
|
};
|
929
|
-
|
929
|
+
var view;
|
930
930
|
if (e.reduce && JSON.parse(e.reduce)) {
|
931
931
|
view = "db_index_reduce";
|
932
932
|
return await runtime_get_query_data();
|
package/studio.mjs
CHANGED
@@ -824,7 +824,7 @@ const query_db = async function (e, db, table_obj) {
|
|
824
824
|
}
|
825
825
|
|
826
826
|
try {
|
827
|
-
const body = await db.query(view
|
827
|
+
const body = await db.query(`xuda/${view}`, opt);
|
828
828
|
if (e.reduce) {
|
829
829
|
let rows = [];
|
830
830
|
|
@@ -917,11 +917,11 @@ const query_db = async function (e, db, table_obj) {
|
|
917
917
|
opt.key = e.table_id;
|
918
918
|
}
|
919
919
|
|
920
|
-
const body = await db.query("db_table_counts", opt);
|
920
|
+
const body = await db.query("xuda/db_table_counts", opt);
|
921
921
|
|
922
922
|
return { code: 1, data: body };
|
923
923
|
};
|
924
|
-
|
924
|
+
var view;
|
925
925
|
if (e.reduce && JSON.parse(e.reduce)) {
|
926
926
|
view = "db_index_reduce";
|
927
927
|
return await runtime_get_query_data();
|
@@ -1189,7 +1189,7 @@ export const create_design = async (params, resolve, reject) => {
|
|
1189
1189
|
const db = params.db;
|
1190
1190
|
|
1191
1191
|
const ddoc = {
|
1192
|
-
_id: "_design",
|
1192
|
+
_id: "_design/xuda",
|
1193
1193
|
views: {
|
1194
1194
|
db_index_reduce: {
|
1195
1195
|
map: 'function(doc) {\r\n if (doc.docType=="database" && doc.stat===3) {\r\n if (doc.udfIndex) {\r\n for (var i = 0; i < doc.udfIndex.length; i++)\r\n {\r\n var val = doc.udfIndex[i]; \r\n emit([val.fileId, val.indexId, val.keyValue],1);\r\n }\r\n }\r\n }\r\n \r\n}',
|