@pi-r/atlas 0.12.5 → 0.13.0

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/client/index.js +3 -3
  2. package/package.json +2 -2
package/client/index.js CHANGED
@@ -84,7 +84,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
84
84
  limit = 1;
85
85
  }
86
86
  const options = item.options ? length === 1 ? Object.assign(item.options, credential) : { ...item.options, ...credential } : length === 1 ? credential : { ...credential };
87
- let rows, queryString = caching && ignoreCache !== true ? (name || '') + '_' + table + '_' + (limit > 0 ? limit.toString() : '0') + Cloud.asString(options, true) + (withFields ? Cloud.asString(withFields, true) : '') + (sort ? Cloud.asString(sort, true) : '') + (item.client ? Cloud.asString(item.client, true) : '') : '', auth, pipeline;
87
+ let rows, queryString = caching && ignoreCache !== true ? Cloud.keyForResult(name, table, Math.max(0, limit), options, withFields, sort, item.client) : '', auth, pipeline;
88
88
  if (queryString) {
89
89
  sanitizeCredentials(options);
90
90
  auth = { uri: item.uri, options };
@@ -113,7 +113,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
113
113
  }
114
114
  if (pipeline || query) {
115
115
  if (queryString) {
116
- queryString += Cloud.asString(aggregate || query, true);
116
+ queryString = Cloud.keyForResult(queryString, aggregate || query);
117
117
  if ((aggregate || !update) && (rows = this.getCacheResult(service, auth, queryString, cacheValue, ignoreCache))) {
118
118
  result[i] = rows;
119
119
  continue;
@@ -176,7 +176,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
176
176
  }
177
177
  else if (distinct) {
178
178
  if (queryString) {
179
- queryString += Cloud.asString(distinct, true);
179
+ queryString = Cloud.keyForResult(queryString, distinct);
180
180
  if (rows = this.getCacheResult(service, auth, queryString, cacheValue, ignoreCache)) {
181
181
  result[i] = rows;
182
182
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/atlas",
3
- "version": "0.12.5",
3
+ "version": "0.13.0",
4
4
  "description": "MongoDB Atlas cloud functions for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "@e-mc/db": "^0.14.6",
21
21
  "@e-mc/module": "^0.14.6",
22
22
  "@e-mc/types": "^0.14.6",
23
- "@pi-r/mongodb": "^0.12.5",
23
+ "@pi-r/mongodb": "^0.13.0",
24
24
  "mongodb": "^7.6.0"
25
25
  }
26
26
  }