@xuda.io/xuda-dbs-plugin-xuda 1.0.134 → 1.0.135

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/server.js +10 -1
  3. package/studio.mjs +13 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.134",
3
+ "version": "1.0.135",
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/server.js CHANGED
@@ -744,7 +744,16 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
744
744
 
745
745
  mango_index_obj = {
746
746
  index: {
747
- fields: [...Object.keys(opt.selector), ...opt.sort],
747
+ fields: Object.keys(
748
+ _.reduce(
749
+ opt.sort,
750
+ (ret, val) => {
751
+ ret[Object.keys(val)[0]] = val;
752
+ return ret;
753
+ },
754
+ opt.selector
755
+ )
756
+ ),
748
757
  },
749
758
  name: index_name,
750
759
  ddoc: `mango_index_table_${e.table_id}`,
package/studio.mjs CHANGED
@@ -1082,7 +1082,16 @@ const query_db = async function (e, db, table_obj) {
1082
1082
 
1083
1083
  mango_index_obj = {
1084
1084
  index: {
1085
- fields: [...Object.keys(opt.selector), ...opt.sort],
1085
+ fields: Object.keys(
1086
+ _.reduce(
1087
+ opt.sort,
1088
+ (ret, val) => {
1089
+ ret[Object.keys(val)[0]] = val;
1090
+ return ret;
1091
+ },
1092
+ opt.selector
1093
+ )
1094
+ ),
1086
1095
  },
1087
1096
  name: index_name,
1088
1097
  ddoc: `mango_index_table_${e.table_id}`,
@@ -1110,11 +1119,11 @@ const query_db = async function (e, db, table_obj) {
1110
1119
  var skip = 0;
1111
1120
 
1112
1121
  if (e.limit) {
1113
- limit = e.limitP;
1122
+ limit = e.limit;
1114
1123
  }
1115
1124
 
1116
- if (e.skipP) {
1117
- skip = e.skipP;
1125
+ if (e.skip) {
1126
+ skip = e.skip;
1118
1127
  }
1119
1128
 
1120
1129
  var view_opt = undefined;