@xuda.io/xuda-dbs-plugin-xuda 1.0.173 → 1.0.175

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/server.js +3 -2
  3. package/studio.mjs +25 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.173",
3
+ "version": "1.0.175",
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
@@ -266,8 +266,9 @@ const get_opt = function (e, table_obj) {
266
266
  }
267
267
  }
268
268
 
269
- if (e.grid_filter_info) {
270
- for (const [key, val] of Object.entries(e.grid_filter_info)) {
269
+ if (e.filterModel) {
270
+ debugger;
271
+ for (const [key, val] of Object.entries(e.filterModel)) {
271
272
  var field_name = key;
272
273
  var condition = "$and";
273
274
  const make_selector = function (val) {
package/studio.mjs CHANGED
@@ -295,8 +295,8 @@ const get_opt = function (e, table_obj) {
295
295
  }
296
296
  }
297
297
 
298
- if (e.grid_filter_info) {
299
- for (const [key, val] of Object.entries(e.grid_filter_info)) {
298
+ if (e.filterModel) {
299
+ for (const [key, val] of Object.entries(e.filterModel)) {
300
300
  var field_name = key;
301
301
  var condition = "$and";
302
302
  const make_selector = function (val) {
@@ -785,37 +785,37 @@ const query_db = async function (e, db, table_obj) {
785
785
  .valueOf()
786
786
  .toString()}`;
787
787
 
788
- const _selector = _.cloneDeep(opt.selector);
788
+ // const _selector = _.cloneDeep(opt.selector);
789
789
  const _sort = _.cloneDeep(opt.sort);
790
- // mango_index_obj = {
791
- // index: {
792
- // fields: [],
793
- // },
794
- // name: index_name,
795
- // ddoc: `mango_index_table_${e.table_id}`,
796
- // };
797
-
798
- // for (let val of _sort) {
799
- // let field_id = Object.keys(val)[0];
800
- // mango_index_obj.index.fields.push(field_id);
801
- // }
802
790
  mango_index_obj = {
803
791
  index: {
804
- fields: Object.keys(
805
- _.reduce(
806
- _sort,
807
- (ret, val) => {
808
- ret[Object.keys(val)[0]] = val;
809
- return ret;
810
- },
811
- _selector
812
- )
813
- ),
792
+ fields: [],
814
793
  },
815
794
  name: index_name,
816
795
  ddoc: `mango_index_table_${e.table_id}`,
817
796
  };
818
797
 
798
+ for (let val of _sort) {
799
+ let field_id = Object.keys(val)[0];
800
+ mango_index_obj.index.fields.push(field_id);
801
+ }
802
+ // mango_index_obj = {
803
+ // index: {
804
+ // fields: Object.keys(
805
+ // _.reduce(
806
+ // _sort,
807
+ // (ret, val) => {
808
+ // ret[Object.keys(val)[0]] = val;
809
+ // return ret;
810
+ // },
811
+ // _selector
812
+ // )
813
+ // ),
814
+ // },
815
+ // name: index_name,
816
+ // ddoc: `mango_index_table_${e.table_id}`,
817
+ // };
818
+
819
819
  try {
820
820
  const result = await db.createIndex(mango_index_obj);
821
821
  // const monitor_indexing = async function () {