@xuda.io/xuda-dbs-plugin-xuda 1.0.66 → 1.0.68

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 (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +24 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
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
@@ -222,11 +222,12 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
222
222
 
223
223
  rows.push({
224
224
  id: val._id,
225
- value: {
226
- udfData: { data: data },
227
- _id: val._id,
228
- _rev: val._rev,
229
- },
225
+ value: data,
226
+ // value: {
227
+ // udfData: { data: data },
228
+ // _id: val._id,
229
+ // _rev: val._rev,
230
+ // },
230
231
  });
231
232
  }
232
233
 
@@ -853,7 +854,22 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
853
854
 
854
855
  var obj = {};
855
856
  for await (const [arr_key, arr_val] of Object.entries(arr)) {
856
- obj[table_index.data.keys[arr_key]] = arr_val;
857
+ let field_id = table_index.data.keys[arr_key];
858
+
859
+ const _tableFieldsObj = find_item_by_key(
860
+ table_obj.tableFields,
861
+ "field_id",
862
+ field_id
863
+ );
864
+
865
+ let field_value = await get_cast_val(
866
+ "dbs_update",
867
+ e.field_id,
868
+ _tableFieldsObj.props.fieldType,
869
+ arr_val
870
+ );
871
+
872
+ obj[field_id] = field_value;
857
873
  }
858
874
  obj["REDUCE_VALUE"] = val.value;
859
875
 
@@ -871,7 +887,8 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
871
887
  }
872
888
  rows.push({
873
889
  id: val.id,
874
- value: { udfData: val.doc.udfData, _id: val.id },
890
+ value: val.doc.udfData,
891
+ // value: { udfData: val.doc.udfData, _id: val.id },
875
892
  });
876
893
  }
877
894