spice-couchbase 2.0.34 → 2.0.36

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/build/index.js CHANGED
@@ -181,9 +181,9 @@ module.exports = class Database {
181
181
 
182
182
  if (!_this3.checkGlobelConnectionObject(_this3.collection_name)) {
183
183
  if (!collection_exists) {
184
- /* await this.createCollection(this.collection_name, this.scope_name);
185
- await this.wait(2000);
186
- await this.createPrimaryIndex(this.scope_name, this.collection_name); */
184
+ yield _this3.createCollection(_this3.collection_name, _this3.scope_name);
185
+ yield _this3.wait(2000);
186
+ yield _this3.createPrimaryIndex(_this3.scope_name, _this3.collection_name);
187
187
  }
188
188
  }
189
189
  } catch (e) {
@@ -204,13 +204,6 @@ module.exports = class Database {
204
204
  function loadAllCollections() {
205
205
  return _loadAllCollections.apply(this, arguments);
206
206
  }
207
- /* console.log("================================");
208
- console.log(
209
- "Collection Set",
210
- spice?.db?.collections?.has(collection_name),
211
- collection_name
212
- ); */
213
-
214
207
 
215
208
  function _loadAllCollections() {
216
209
  _loadAllCollections = _asyncToGenerator(function* () {
@@ -237,14 +230,11 @@ module.exports = class Database {
237
230
  }
238
231
 
239
232
  if ((_spice2 = spice) === null || _spice2 === void 0 ? void 0 : (_spice2$db = _spice2.db) === null || _spice2$db === void 0 ? void 0 : (_spice2$db$collection = _spice2$db.collections) === null || _spice2$db$collection === void 0 ? void 0 : _spice2$db$collection.has(collection_name)) {
240
- //console.log("Using Internal Collection Set", true);
241
233
  return true;
242
234
  } else {
243
235
  var _spice3, _spice3$db, _spice3$db$collection;
244
236
 
245
- //console.log("Using Internal Collection Set", false);
246
- spice.db.collections = yield loadAllCollections(); //console.log("Collection Set", spice.db.collections.entries());
247
-
237
+ spice.db.collections = yield loadAllCollections();
248
238
  return (_spice3 = spice) === null || _spice3 === void 0 ? void 0 : (_spice3$db = _spice3.db) === null || _spice3$db === void 0 ? void 0 : (_spice3$db$collection = _spice3$db.collections) === null || _spice3$db$collection === void 0 ? void 0 : _spice3$db$collection.has(collection_name);
249
239
  }
250
240
  } catch (e) {
@@ -333,7 +323,6 @@ module.exports = class Database {
333
323
  console.log(e.message, e, doc_id);
334
324
  }
335
325
 
336
- console.log("Return from Insert", doc_id);
337
326
  return yield _this9.get(doc_id);
338
327
  })();
339
328
  }
@@ -381,13 +370,9 @@ module.exports = class Database {
381
370
  var _this14 = this;
382
371
 
383
372
  return _asyncToGenerator(function* () {
384
- /* var that = this; */
385
-
386
- /* return new Promise(async function (resolve, reject) { */
387
373
  if (keys.length == 0) {
388
374
  return [];
389
- } // console.log("on Multiget", keys);
390
-
375
+ }
391
376
 
392
377
  if (_.isArray(keys) && keys.length > 0) {
393
378
  var functions = _.map(keys, key => (_this14.use_bucket_name ? _this14.connection : _this14.collection).get(key));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-couchbase",
3
- "version": "2.0.34",
3
+ "version": "2.0.36",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -211,20 +211,10 @@ module.exports = class Database {
211
211
  });
212
212
  return collectionSet;
213
213
  }
214
- /* console.log("================================");
215
- console.log(
216
- "Collection Set",
217
- spice?.db?.collections?.has(collection_name),
218
- collection_name
219
- ); */
220
214
  if (spice?.db?.collections?.has(collection_name)) {
221
- //console.log("Using Internal Collection Set", true);
222
215
  return true;
223
216
  } else {
224
- //console.log("Using Internal Collection Set", false);
225
-
226
217
  spice.db.collections = await loadAllCollections();
227
- //console.log("Collection Set", spice.db.collections.entries());
228
218
  return spice?.db?.collections?.has(collection_name);
229
219
  }
230
220
  } catch (e) {
@@ -300,7 +290,6 @@ module.exports = class Database {
300
290
  } catch (e) {
301
291
  console.log(e.message, e, doc_id);
302
292
  }
303
- console.log("Return from Insert", doc_id);
304
293
  return await this.get(doc_id);
305
294
  }
306
295
 
@@ -339,12 +328,9 @@ module.exports = class Database {
339
328
  }
340
329
 
341
330
  async multi_get(keys, keep_type) {
342
- /* var that = this; */
343
- /* return new Promise(async function (resolve, reject) { */
344
331
  if (keys.length == 0) {
345
332
  return [];
346
333
  }
347
- // console.log("on Multiget", keys);
348
334
  if (_.isArray(keys) && keys.length > 0) {
349
335
  let functions = _.map(keys, (key) =>
350
336
  (this.use_bucket_name ? this.connection : this.collection).get(key)