@xuda.io/xuda-dbs-plugin-xuda 1.0.162 → 1.0.164
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/studio.mjs +22 -11
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@xuda.io/xuda-dbs-plugin-xuda",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.164",
|
4
4
|
"description": "Xuda Database Socket for Xuda's proprietary structure powered by CouchDB",
|
5
5
|
"scripts": {
|
6
6
|
"pub": "npm version patch --force && npm publish --access public"
|
package/studio.mjs
CHANGED
@@ -283,7 +283,7 @@ const get_opt = function (e, table_obj) {
|
|
283
283
|
opt.sort = sort;
|
284
284
|
}
|
285
285
|
|
286
|
-
if (e?.sortModel
|
286
|
+
if (e?.sortModel && JSON.parse(e.sortModel).length) {
|
287
287
|
opt.sort = JSON.parse(e.sortModel);
|
288
288
|
if (opt.sort) {
|
289
289
|
for (const [key, val] of Object.entries(opt.sort)) {
|
@@ -781,21 +781,32 @@ const query_db = async function (e, db, table_obj) {
|
|
781
781
|
const _sort = _.cloneDeep(opt.sort);
|
782
782
|
mango_index_obj = {
|
783
783
|
index: {
|
784
|
-
fields:
|
785
|
-
_.reduce(
|
786
|
-
_sort,
|
787
|
-
(ret, val) => {
|
788
|
-
ret[Object.keys(val)[0]] = val;
|
789
|
-
return ret;
|
790
|
-
},
|
791
|
-
_selector
|
792
|
-
)
|
793
|
-
),
|
784
|
+
fields: [],
|
794
785
|
},
|
795
786
|
name: index_name,
|
796
787
|
ddoc: `mango_index_table_${e.table_id}`,
|
797
788
|
};
|
798
789
|
|
790
|
+
for (let [key, val] of Object.entries(_sort)) {
|
791
|
+
mango_index_obj.index.fields.push(key);
|
792
|
+
}
|
793
|
+
// mango_index_obj = {
|
794
|
+
// index: {
|
795
|
+
// fields: Object.keys(
|
796
|
+
// _.reduce(
|
797
|
+
// _sort,
|
798
|
+
// (ret, val) => {
|
799
|
+
// ret[Object.keys(val)[0]] = val;
|
800
|
+
// return ret;
|
801
|
+
// },
|
802
|
+
// _selector
|
803
|
+
// )
|
804
|
+
// ),
|
805
|
+
// },
|
806
|
+
// name: index_name,
|
807
|
+
// ddoc: `mango_index_table_${e.table_id}`,
|
808
|
+
// };
|
809
|
+
|
799
810
|
try {
|
800
811
|
const result = await db.createIndex(mango_index_obj);
|
801
812
|
// const monitor_indexing = async function () {
|