spice-couchbase 2.0.32 → 2.0.34
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 +8 -1
- package/package.json +1 -1
- package/src/index.js +7 -3
package/build/index.js
CHANGED
|
@@ -24,6 +24,10 @@ var {
|
|
|
24
24
|
ConflictResolutionType
|
|
25
25
|
} = require("couchbase");
|
|
26
26
|
|
|
27
|
+
var {
|
|
28
|
+
QueryScanConsistency
|
|
29
|
+
} = require("couchbase");
|
|
30
|
+
|
|
27
31
|
if (!Promise.allSettled) {
|
|
28
32
|
Promise.allSettled = promises => Promise.all(promises.map((promise, i) => promise.then(value => ({
|
|
29
33
|
status: "fulfilled",
|
|
@@ -666,7 +670,10 @@ module.exports = class Database {
|
|
|
666
670
|
|
|
667
671
|
|
|
668
672
|
var startTime = process.hrtime.bigint();
|
|
669
|
-
var
|
|
673
|
+
var options = {
|
|
674
|
+
scanConsistency: QueryScanConsistency.RequestPlus
|
|
675
|
+
};
|
|
676
|
+
var response = yield exec_scope.query(sanitizedQuery, options); // End time
|
|
670
677
|
|
|
671
678
|
var endTime = process.hrtime.bigint(); // Calculate duration in microseconds
|
|
672
679
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ let couchbase = require("couchbase");
|
|
|
5
5
|
const { default: axios } = require("axios");
|
|
6
6
|
var qs = require("qs");
|
|
7
7
|
const { ConflictResolutionType } = require("couchbase");
|
|
8
|
+
const { QueryScanConsistency } = require("couchbase");
|
|
8
9
|
|
|
9
10
|
if (!Promise.allSettled) {
|
|
10
11
|
Promise.allSettled = (promises) =>
|
|
@@ -178,9 +179,9 @@ module.exports = class Database {
|
|
|
178
179
|
);
|
|
179
180
|
if (!this.checkGlobelConnectionObject(this.collection_name)) {
|
|
180
181
|
if (!collection_exists) {
|
|
181
|
-
|
|
182
|
+
await this.createCollection(this.collection_name, this.scope_name);
|
|
182
183
|
await this.wait(2000);
|
|
183
|
-
await this.createPrimaryIndex(this.scope_name, this.collection_name);
|
|
184
|
+
await this.createPrimaryIndex(this.scope_name, this.collection_name);
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
} catch (e) {
|
|
@@ -583,7 +584,10 @@ module.exports = class Database {
|
|
|
583
584
|
}
|
|
584
585
|
// Start time
|
|
585
586
|
let startTime = process.hrtime.bigint();
|
|
586
|
-
|
|
587
|
+
const options = {
|
|
588
|
+
scanConsistency: QueryScanConsistency.RequestPlus,
|
|
589
|
+
};
|
|
590
|
+
let response = await exec_scope.query(sanitizedQuery, options);
|
|
587
591
|
// End time
|
|
588
592
|
let endTime = process.hrtime.bigint();
|
|
589
593
|
// Calculate duration in microseconds
|