couchbase
Advanced tools
Comparing version 4.2.5 to 4.2.6-dev
@@ -103,2 +103,3 @@ cmake_minimum_required(VERSION 3.17) | ||
core/n1ql_query_options.cxx | ||
core/origin.cxx | ||
core/range_scan_options.cxx | ||
@@ -269,6 +270,6 @@ core/range_scan_orchestrator.cxx | ||
core/impl/cluster.cxx | ||
core/impl/collection_query_index_manager.cxx | ||
core/impl/common_error_category.cxx | ||
core/impl/configuration_profiles_registry.cxx | ||
core/impl/conjunction_query.cxx | ||
core/impl/create_bucket.cxx | ||
core/impl/create_query_index.cxx | ||
@@ -282,2 +283,3 @@ core/impl/date_range.cxx | ||
core/impl/dns_srv_tracker.cxx | ||
core/impl/drop_bucket.cxx | ||
core/impl/drop_query_index.cxx | ||
@@ -288,2 +290,3 @@ core/impl/exists.cxx | ||
core/impl/field_level_encryption_error_category.cxx | ||
core/impl/flush_bucket.cxx | ||
core/impl/geo_bounding_box_query.cxx | ||
@@ -293,2 +296,3 @@ core/impl/geo_distance_query.cxx | ||
core/impl/get.cxx | ||
core/impl/get_all_buckets.cxx | ||
core/impl/get_all_query_indexes.cxx | ||
@@ -299,2 +303,3 @@ core/impl/get_all_replicas.cxx | ||
core/impl/get_any_replica.cxx | ||
core/impl/get_bucket.cxx | ||
core/impl/get_replica.cxx | ||
@@ -304,2 +309,3 @@ core/impl/increment.cxx | ||
core/impl/internal_date_range_facet_result.cxx | ||
core/impl/internal_manager_error_context.cxx | ||
core/impl/internal_numeric_range_facet_result.cxx | ||
@@ -316,2 +322,3 @@ core/impl/internal_search_error_context.cxx | ||
core/impl/management_error_category.cxx | ||
core/impl/manager_error_context.cxx | ||
core/impl/match_all_query.cxx | ||
@@ -379,2 +386,3 @@ core/impl/match_none_query.cxx | ||
core/impl/unlock.cxx | ||
core/impl/update_bucket.cxx | ||
core/impl/upsert.cxx | ||
@@ -381,0 +389,0 @@ core/impl/view_error_category.cxx |
@@ -144,2 +144,3 @@ # cbc-analytics - Run Analytics Query {#cbc-analytics} | ||
<dt>`--user-agent-extra=STRING`</dt><dd>Append extra string SDK identifiers. [default: `cbc`].</dd> | ||
<dt>`--network=STRING`</dt><dd>Network (a.k.a. Alternate Addresses) to use. [default: `auto`]</dd> | ||
<dt>`--show-queries`</dt><dd>Log queries on INFO level.</dd> | ||
@@ -146,0 +147,0 @@ <dt>`--enable-clustermap-notifications`</dt><dd>Allow server to send notifications when cluster configuration changes.</dd> |
@@ -144,2 +144,3 @@ # cbc-get - Retrieve Documents from the Server {#cbc-get} | ||
<dt>`--user-agent-extra=STRING`</dt><dd>Append extra string SDK identifiers. [default: `cbc`].</dd> | ||
<dt>`--network=STRING`</dt><dd>Network (a.k.a. Alternate Addresses) to use. [default: `auto`]</dd> | ||
<dt>`--show-queries`</dt><dd>Log queries on INFO level.</dd> | ||
@@ -146,0 +147,0 @@ <dt>`--enable-clustermap-notifications`</dt><dd>Allow server to send notifications when cluster configuration changes.</dd> |
@@ -151,2 +151,3 @@ # cbc-pillowfight - Simple Workload Generator {#cbc-pillowfight} | ||
<dt>`--user-agent-extra=STRING`</dt><dd>Append extra string SDK identifiers. [default: `cbc`].</dd> | ||
<dt>`--network=STRING`</dt><dd>Network (a.k.a. Alternate Addresses) to use. [default: `auto`]</dd> | ||
<dt>`--show-queries`</dt><dd>Log queries on INFO level.</dd> | ||
@@ -153,0 +154,0 @@ <dt>`--enable-clustermap-notifications`</dt><dd>Allow server to send notifications when cluster configuration changes.</dd> |
@@ -152,2 +152,3 @@ # cbc-query - Execute N1QL Query {#cbc-query} | ||
<dt>`--user-agent-extra=STRING`</dt><dd>Append extra string SDK identifiers. [default: `cbc`].</dd> | ||
<dt>`--network=STRING`</dt><dd>Network (a.k.a. Alternate Addresses) to use. [default: `auto`]</dd> | ||
<dt>`--show-queries`</dt><dd>Log queries on INFO level.</dd> | ||
@@ -154,0 +155,0 @@ <dt>`--enable-clustermap-notifications`</dt><dd>Allow server to send notifications when cluster configuration changes.</dd> |
@@ -35,2 +35,12 @@ # cbc - Couchbase client {#cbc} | ||
</dd> | ||
<dt>analytics</dt> | ||
<dd> | ||
Perform Analytics query. See [cbc-analytics](md_docs_2cbc-analytics) for more information. | ||
</dd> | ||
<dt>pillowfight</dt> | ||
<dd> | ||
Run simple workload generator. See [cbc-pillowfight](md_docs_2cbc-pillowfight) for more information. | ||
</dd> | ||
</dl> | ||
@@ -37,0 +47,0 @@ |
@@ -29,2 +29,3 @@ add_subdirectory(utils) | ||
unit_test(search) | ||
unit_test(query) | ||
target_link_libraries(test_unit_jsonsl jsonsl) | ||
@@ -31,0 +32,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CppTxnExternalException = exports.CppTxnFailureType = exports.CppScanSort = exports.CppReplicateTo = exports.CppPersistTo = exports.CppStoreSemantics = exports.CppImplSubdocOpcode = exports.CppKeyValueStatusCode = exports.CppErrcNetwork = exports.CppErrcFieldLevelEncryption = exports.CppErrcManagement = exports.CppErrcView = exports.CppErrcSearch = exports.CppErrcAnalytics = exports.CppErrcQuery = exports.CppErrcKeyValue = exports.CppErrcCommon = exports.CppDurabilityLevel = exports.CppAnalyticsResponseAnalyticsStatus = exports.CppViewSortOrder = exports.CppViewScanConsistency = exports.CppViewOnError = exports.CppServiceType = exports.CppSearchScanConsistency = exports.CppSearchHighlightStyle = exports.CppQueryScanConsistency = exports.CppQueryProfile = exports.CppDiagPingState = exports.CppDiagEndpointState = exports.CppDiagClusterState = exports.CppDesignDocumentNamespace = exports.CppAnalyticsScanConsistency = exports.CppProtocolSubdocOpcode = exports.CppRetryReason = exports.CppManagementRbacAuthDomain = exports.CppManagementEventingFunctionProcessingStatus = exports.CppManagementEventingFunctionDeploymentStatus = exports.CppManagementEventingFunctionStatus = exports.CppManagementEventingFunctionBucketAccess = exports.CppManagementEventingFunctionLogLevel = exports.CppManagementEventingFunctionLanguageCompatibility = exports.CppManagementEventingFunctionDcpBoundary = exports.CppManagementClusterBucketStorageBackend = exports.CppManagementClusterBucketConflictResolution = exports.CppManagementClusterBucketEvictionPolicy = exports.CppManagementClusterBucketCompression = exports.CppManagementClusterBucketType = exports.CppManagementAnalyticsCouchbaseLinkEncryptionLevel = exports.zeroCas = void 0; | ||
exports.CppTxnExternalException = exports.CppTxnFailureType = exports.CppReplicateTo = exports.CppPersistTo = exports.CppStoreSemantics = exports.CppImplSubdocOpcode = exports.CppKeyValueStatusCode = exports.CppErrcNetwork = exports.CppErrcFieldLevelEncryption = exports.CppErrcManagement = exports.CppErrcView = exports.CppErrcSearch = exports.CppErrcAnalytics = exports.CppErrcQuery = exports.CppErrcKeyValue = exports.CppErrcCommon = exports.CppDurabilityLevel = exports.CppAnalyticsResponseAnalyticsStatus = exports.CppViewSortOrder = exports.CppViewScanConsistency = exports.CppViewOnError = exports.CppServiceType = exports.CppSearchScanConsistency = exports.CppSearchHighlightStyle = exports.CppQueryScanConsistency = exports.CppQueryProfile = exports.CppDiagPingState = exports.CppDiagEndpointState = exports.CppDiagClusterState = exports.CppDesignDocumentNamespace = exports.CppAnalyticsScanConsistency = exports.CppProtocolSubdocOpcode = exports.CppRetryReason = exports.CppManagementRbacAuthDomain = exports.CppManagementEventingFunctionProcessingStatus = exports.CppManagementEventingFunctionDeploymentStatus = exports.CppManagementEventingFunctionStatus = exports.CppManagementEventingFunctionBucketAccess = exports.CppManagementEventingFunctionLogLevel = exports.CppManagementEventingFunctionLanguageCompatibility = exports.CppManagementEventingFunctionDcpBoundary = exports.CppManagementClusterBucketStorageBackend = exports.CppManagementClusterBucketConflictResolution = exports.CppManagementClusterBucketEvictionPolicy = exports.CppManagementClusterBucketCompression = exports.CppManagementClusterBucketType = exports.CppManagementAnalyticsCouchbaseLinkEncryptionLevel = exports.zeroCas = void 0; | ||
/* | ||
@@ -151,5 +151,2 @@ eslint | ||
})(CppReplicateTo = exports.CppReplicateTo || (exports.CppReplicateTo = {})); | ||
var CppScanSort; | ||
(function (CppScanSort) { | ||
})(CppScanSort = exports.CppScanSort || (exports.CppScanSort = {})); | ||
var CppTxnFailureType; | ||
@@ -156,0 +153,0 @@ (function (CppTxnFailureType) { |
import { AnalyticsScanConsistency, AnalyticsStatus } from './analyticstypes'; | ||
import { CppAnalyticsScanConsistency, CppAnalyticsResponseAnalyticsStatus, CppDurabilityLevel, CppDiagEndpointState, CppMutationState, CppDiagPingState, CppQueryProfile, CppQueryScanConsistency, CppSearchHighlightStyle, CppSearchScanConsistency, CppServiceType, CppStoreSemantics, CppTxnExternalException, CppViewScanConsistency, CppViewSortOrder, CppPersistTo, CppReplicateTo, CppTxnOpException } from './binding'; | ||
import { CppAnalyticsScanConsistency, CppAnalyticsResponseAnalyticsStatus, CppDurabilityLevel, CppDiagEndpointState, CppMutationState, CppDiagPingState, CppQueryProfile, CppQueryScanConsistency, CppSearchHighlightStyle, CppSearchScanConsistency, CppServiceType, CppStoreSemantics, CppTxnExternalException, CppViewScanConsistency, CppViewSortOrder, CppPersistTo, CppReplicateTo, CppTxnOpException, CppRangeScan, CppSamplingScan, CppPrefixScan } from './binding'; | ||
import { CppError } from './binding'; | ||
@@ -9,2 +9,3 @@ import { EndpointState, PingState } from './diagnosticstypes'; | ||
import { QueryProfileMode, QueryScanConsistency } from './querytypes'; | ||
import { RangeScan, SamplingScan, PrefixScan } from './rangeScan'; | ||
import { SearchScanConsistency, HighlightStyle } from './searchtypes'; | ||
@@ -96,1 +97,5 @@ import { ViewOrdering, ViewScanConsistency } from './viewtypes'; | ||
export declare function errorFromCpp(err: CppError | null): Error | null; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function scanTypeToCpp(scanType: RangeScan | SamplingScan | PrefixScan): CppRangeScan | CppSamplingScan | CppPrefixScan; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.errorFromCpp = exports.contextFromCpp = exports.pingStateFromCpp = exports.txnOpExeptionFromCpp = exports.txnExternalExceptionStringFromCpp = exports.endpointStateFromCpp = exports.serviceTypeFromCpp = exports.serviceTypeToCpp = exports.mutationStateToCpp = exports.searchHighlightStyleToCpp = exports.searchScanConsistencyToCpp = exports.analyticsStatusFromCpp = exports.analyticsScanConsistencyToCpp = exports.queryProfileToCpp = exports.queryScanConsistencyToCpp = exports.viewOrderingToCpp = exports.viewScanConsistencyToCpp = exports.storeSemanticToCpp = exports.replicateToToCpp = exports.persistToToCpp = exports.durabilityToCpp = void 0; | ||
exports.scanTypeToCpp = exports.errorFromCpp = exports.contextFromCpp = exports.pingStateFromCpp = exports.txnOpExeptionFromCpp = exports.txnExternalExceptionStringFromCpp = exports.endpointStateFromCpp = exports.serviceTypeFromCpp = exports.serviceTypeToCpp = exports.mutationStateToCpp = exports.searchHighlightStyleToCpp = exports.searchScanConsistencyToCpp = exports.analyticsStatusFromCpp = exports.analyticsScanConsistencyToCpp = exports.queryProfileToCpp = exports.queryScanConsistencyToCpp = exports.viewOrderingToCpp = exports.viewScanConsistencyToCpp = exports.storeSemanticToCpp = exports.replicateToToCpp = exports.persistToToCpp = exports.durabilityToCpp = void 0; | ||
const analyticstypes_1 = require("./analyticstypes"); | ||
@@ -38,2 +38,3 @@ const binding_1 = __importDefault(require("./binding")); | ||
const querytypes_1 = require("./querytypes"); | ||
const rangeScan_1 = require("./rangeScan"); | ||
const searchtypes_1 = require("./searchtypes"); | ||
@@ -760,1 +761,35 @@ const viewtypes_1 = require("./viewtypes"); | ||
exports.errorFromCpp = errorFromCpp; | ||
/** | ||
* @internal | ||
*/ | ||
function scanTypeToCpp(scanType) { | ||
var _a, _b, _c, _d; | ||
if (scanType instanceof rangeScan_1.RangeScan) { | ||
return { | ||
from: scanType.start !== undefined | ||
? { | ||
term: scanType.start.term, | ||
exclusive: (_b = (_a = scanType.start) === null || _a === void 0 ? void 0 : _a.exclusive) !== null && _b !== void 0 ? _b : false, | ||
} | ||
: undefined, | ||
to: scanType.end !== undefined | ||
? { | ||
term: scanType.end.term, | ||
exclusive: (_d = (_c = scanType.end) === null || _c === void 0 ? void 0 : _c.exclusive) !== null && _d !== void 0 ? _d : false, | ||
} | ||
: undefined, | ||
}; | ||
} | ||
else if (scanType instanceof rangeScan_1.SamplingScan) { | ||
return { | ||
limit: scanType.limit, | ||
seed: scanType.seed, | ||
}; | ||
} | ||
else { | ||
return { | ||
prefix: scanType.prefix, | ||
}; | ||
} | ||
} | ||
exports.scanTypeToCpp = scanTypeToCpp; |
/// <reference types="node" /> | ||
import { IncrementOptions, DecrementOptions, AppendOptions, PrependOptions, BinaryCollection } from './binarycollection'; | ||
import { CppDocumentId, CppConnection } from './binding'; | ||
import { CppDocumentId, CppConnection, CppScanIterator, CppRangeScanOrchestratorOptions } from './binding'; | ||
import { Cluster } from './cluster'; | ||
import { CounterResult, ExistsResult, GetReplicaResult, GetResult, LookupInResult, MutateInResult, MutationResult } from './crudoptypes'; | ||
import { CounterResult, ExistsResult, GetReplicaResult, GetResult, LookupInResult, MutateInResult, MutationResult, ScanResult } from './crudoptypes'; | ||
import { CouchbaseList, CouchbaseMap, CouchbaseQueue, CouchbaseSet } from './datastructures'; | ||
import { DurabilityLevel, StoreSemantics } from './generaltypes'; | ||
import { MutationState } from './mutationstate'; | ||
import { CollectionQueryIndexManager } from './queryindexmanager'; | ||
import { RangeScan, SamplingScan, PrefixScan } from './rangeScan'; | ||
import { Scope } from './scope'; | ||
import { LookupInSpec, MutateInSpec } from './sdspecs'; | ||
import { StreamableReplicasPromise } from './streamablepromises'; | ||
import { StreamableReplicasPromise, StreamableScanPromise } from './streamablepromises'; | ||
import { Transcoder } from './transcoders'; | ||
@@ -322,2 +324,41 @@ import { NodeCallback, Cas } from './utilities'; | ||
/** | ||
* Volatile: This API is subject to change at any time. | ||
* | ||
* @category Key-Value | ||
*/ | ||
export interface ScanOptions { | ||
/** | ||
* Specifies an explicit transcoder to use for this specific operation. | ||
*/ | ||
transcoder?: Transcoder; | ||
/** | ||
* The timeout for this operation, represented in milliseconds. | ||
*/ | ||
timeout?: number; | ||
/** | ||
* If the scan should only return document ids. | ||
*/ | ||
idsOnly?: boolean; | ||
/** | ||
* The limit applied to the number of bytes returned from the server | ||
* for each partition batch. | ||
*/ | ||
batchByteLimit?: number; | ||
/** | ||
* The limit applied to the number of items returned from the server | ||
* for each partition batch. | ||
*/ | ||
batchItemLimit?: number; | ||
/** | ||
* Specifies a MutationState which the scan should be consistent with. | ||
* | ||
* @see {@link MutationState} | ||
*/ | ||
consistentWith?: MutationState; | ||
/** | ||
* Specifies the number of vBuckets which the client should scan in parallel. | ||
*/ | ||
concurrency?: number; | ||
} | ||
/** | ||
* Exposes the operations which are available to be performed against a collection. | ||
@@ -336,2 +377,5 @@ * Namely the ability to perform KV operations. | ||
private _conn; | ||
private _kvScanTimeout; | ||
private _scanBatchItemLimit; | ||
private _scanBatchByteLimit; | ||
/** | ||
@@ -501,2 +545,20 @@ @internal | ||
/** | ||
* @internal | ||
*/ | ||
_continueScan(iterator: CppScanIterator, transcoder: Transcoder, emitter: StreamableScanPromise<ScanResult[], ScanResult>): void; | ||
/** | ||
* @internal | ||
*/ | ||
_doScan(scanType: RangeScan | SamplingScan | PrefixScan, options: CppRangeScanOrchestratorOptions, transcoder: Transcoder, callback?: NodeCallback<ScanResult[]>): StreamableScanPromise<ScanResult[], ScanResult>; | ||
/** | ||
* Performs a key-value scan operation. | ||
* | ||
* Volatile: This API is subject to change at any time. | ||
* | ||
* @param scanType The type of scan to execute. | ||
* @param options Optional parameters for the scan operation. | ||
* @param callback A node-style callback to be invoked after execution. | ||
*/ | ||
scan(scanType: RangeScan | SamplingScan | PrefixScan, options?: ScanOptions, callback?: NodeCallback<ScanResult[]>): Promise<ScanResult[]>; | ||
/** | ||
* Performs a lookup-in operation against a document, fetching individual fields or | ||
@@ -503,0 +565,0 @@ * information about specific fields inside the document value. |
@@ -32,4 +32,6 @@ "use strict"; | ||
const datastructures_1 = require("./datastructures"); | ||
const errors_1 = require("./errors"); | ||
const generaltypes_1 = require("./generaltypes"); | ||
const queryindexmanager_1 = require("./queryindexmanager"); | ||
const rangeScan_1 = require("./rangeScan"); | ||
const sdspecs_1 = require("./sdspecs"); | ||
@@ -59,2 +61,5 @@ const sdutils_1 = require("./sdutils"); | ||
this._conn = scope.conn; | ||
this._kvScanTimeout = 75000; | ||
this._scanBatchByteLimit = 15000; | ||
this._scanBatchItemLimit = 50; | ||
} | ||
@@ -811,2 +816,104 @@ /** | ||
/** | ||
* @internal | ||
*/ | ||
_continueScan(iterator, transcoder, emitter) { | ||
iterator.next((cppErr, resp) => { | ||
const err = (0, bindingutilities_1.errorFromCpp)(cppErr); | ||
if (err) { | ||
emitter.emit('error', err); | ||
emitter.emit('end'); | ||
return; | ||
} | ||
if (typeof resp === 'undefined') { | ||
emitter.emit('end'); | ||
return; | ||
} | ||
const key = resp.key; | ||
if (typeof resp.body !== 'undefined') { | ||
const cas = resp.body.cas; | ||
const expiry = resp.body.expiry; | ||
this._decodeDoc(transcoder, resp.body.value, resp.body.flags, (err, content) => { | ||
if (err) { | ||
emitter.emit('error', err); | ||
emitter.emit('end'); | ||
return; | ||
} | ||
emitter.emit('result', new crudoptypes_1.ScanResult({ | ||
id: key, | ||
content: content, | ||
cas: cas, | ||
expiryTime: expiry, | ||
})); | ||
}); | ||
} | ||
else { | ||
emitter.emit('result', new crudoptypes_1.ScanResult({ | ||
id: key, | ||
})); | ||
} | ||
if (emitter.cancelRequested && !iterator.cancelled) { | ||
iterator.cancel(); | ||
} | ||
this._continueScan(iterator, transcoder, emitter); | ||
return; | ||
}); | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
_doScan(scanType, options, transcoder, callback) { | ||
const bucketName = this._scope.bucket.name; | ||
const scopeName = this._scope.name; | ||
const collectionName = this._name; | ||
return utilities_1.PromiseHelper.wrapAsync(() => { | ||
const { cppErr, result } = this._conn.scan(bucketName, scopeName, collectionName, scanType.getScanType(), (0, bindingutilities_1.scanTypeToCpp)(scanType), options); | ||
const err = (0, bindingutilities_1.errorFromCpp)(cppErr); | ||
if (err) { | ||
throw err; | ||
} | ||
const emitter = new streamablepromises_1.StreamableScanPromise((results) => results); | ||
this._continueScan(result, transcoder, emitter); | ||
return emitter; | ||
}, callback); | ||
} | ||
/** | ||
* Performs a key-value scan operation. | ||
* | ||
* Volatile: This API is subject to change at any time. | ||
* | ||
* @param scanType The type of scan to execute. | ||
* @param options Optional parameters for the scan operation. | ||
* @param callback A node-style callback to be invoked after execution. | ||
*/ | ||
scan(scanType, options, callback) { | ||
if (options instanceof Function) { | ||
callback = arguments[2]; | ||
options = undefined; | ||
} | ||
if (!options) { | ||
options = {}; | ||
} | ||
const transcoder = options.transcoder || this.transcoder; | ||
const timeout = options.timeout || this._kvScanTimeout; | ||
const idsOnly = options.idsOnly || false; | ||
const batchByteLimit = options.batchByteLimit || this._scanBatchByteLimit; | ||
const batchItemLimit = options.batchByteLimit || this._scanBatchItemLimit; | ||
if (typeof options.concurrency !== 'undefined' && options.concurrency < 1) { | ||
throw new errors_1.InvalidArgumentError(new Error('Concurrency option must be positive')); | ||
} | ||
const concurrency = options.concurrency || 1; | ||
if (scanType instanceof rangeScan_1.SamplingScan && scanType.limit < 1) { | ||
throw new errors_1.InvalidArgumentError(new Error('Sampling scan limit must be positive')); | ||
} | ||
const orchestratorOptions = { | ||
ids_only: idsOnly, | ||
consistent_with: (0, bindingutilities_1.mutationStateToCpp)(options.consistentWith), | ||
batch_item_limit: batchItemLimit, | ||
batch_byte_limit: batchByteLimit, | ||
concurrency: concurrency, | ||
timeout: timeout, | ||
}; | ||
return this._doScan(scanType, orchestratorOptions, transcoder, callback); | ||
} | ||
/** | ||
* Performs a lookup-in operation against a document, fetching individual fields or | ||
@@ -813,0 +920,0 @@ * information about specific fields inside the document value. |
@@ -46,2 +46,36 @@ import { MutationToken } from './mutationstate'; | ||
/** | ||
* Contains the results of a Range or Sampling Scan operation. | ||
* | ||
* @category Key-Value | ||
*/ | ||
export declare class ScanResult { | ||
/** | ||
* The content of the document. | ||
*/ | ||
id: string; | ||
/** | ||
* The content of the document. | ||
*/ | ||
content?: any; | ||
/** | ||
* The CAS of the document. | ||
*/ | ||
cas?: Cas; | ||
/** | ||
* The expiry of the document, if it was requested. | ||
* | ||
* @see {@link GetOptions.withExpiry} | ||
*/ | ||
expiryTime?: number; | ||
/** | ||
* @internal | ||
*/ | ||
constructor(data: { | ||
id: string; | ||
content?: any; | ||
cas?: Cas; | ||
expiryTime?: number; | ||
}); | ||
} | ||
/** | ||
* Contains the results of an exists operation. | ||
@@ -48,0 +82,0 @@ * |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CounterResult = exports.MutateInResult = exports.MutateInResultEntry = exports.LookupInResult = exports.LookupInResultEntry = exports.GetReplicaResult = exports.MutationResult = exports.ExistsResult = exports.GetResult = void 0; | ||
exports.CounterResult = exports.MutateInResult = exports.MutateInResultEntry = exports.LookupInResult = exports.LookupInResultEntry = exports.GetReplicaResult = exports.MutationResult = exports.ExistsResult = exports.ScanResult = exports.GetResult = void 0; | ||
/** | ||
@@ -40,2 +40,19 @@ * Contains the results of a Get operation. | ||
/** | ||
* Contains the results of a Range or Sampling Scan operation. | ||
* | ||
* @category Key-Value | ||
*/ | ||
class ScanResult { | ||
/** | ||
* @internal | ||
*/ | ||
constructor(data) { | ||
this.id = data.id; | ||
this.content = data.content; | ||
this.cas = data.cas; | ||
this.expiryTime = data.expiryTime; | ||
} | ||
} | ||
exports.ScanResult = ScanResult; | ||
/** | ||
* Contains the results of an exists operation. | ||
@@ -42,0 +59,0 @@ * |
@@ -98,2 +98,3 @@ "use strict"; | ||
preserve_expiry: options.preserveExpiry || false, | ||
use_replica: options.useReplica, | ||
max_parallelism: options.maxParallelism, | ||
@@ -100,0 +101,0 @@ scan_cap: options.scanCap, |
@@ -284,2 +284,9 @@ import { MutationState } from './mutationstate'; | ||
/** | ||
* Uncommitted: This API is subject to change in the future. | ||
* | ||
* Specifies whether the query engine should use replica nodes for kv fetches, | ||
* if the active node is down. | ||
*/ | ||
useReplica?: boolean; | ||
/** | ||
* Specifies the level of profiling that should be used for the query. | ||
@@ -286,0 +293,0 @@ */ |
@@ -42,2 +42,8 @@ /// <reference types="node" /> | ||
} | ||
export declare class StreamableScanPromise<T, TRes> extends StreamablePromise<T> { | ||
private _cancelRequested; | ||
constructor(fn: (results: TRes[]) => T); | ||
get cancelRequested(): boolean; | ||
cancelStreaming(): void; | ||
} | ||
export {}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StreamableReplicasPromise = exports.StreamableRowPromise = exports.StreamablePromise = void 0; | ||
exports.StreamableScanPromise = exports.StreamableReplicasPromise = exports.StreamableRowPromise = exports.StreamablePromise = void 0; | ||
/* eslint jsdoc/require-jsdoc: off */ | ||
@@ -91,1 +91,25 @@ const events_1 = __importDefault(require("events")); | ||
exports.StreamableReplicasPromise = StreamableReplicasPromise; | ||
class StreamableScanPromise extends StreamablePromise { | ||
constructor(fn) { | ||
super((emitter, resolve, reject) => { | ||
let err; | ||
const results = []; | ||
emitter.on('result', (r) => results.push(r)); | ||
emitter.on('error', (e) => (err = e)); | ||
emitter.on('end', () => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
resolve(fn(results)); | ||
}); | ||
}); | ||
this._cancelRequested = false; | ||
} | ||
get cancelRequested() { | ||
return this._cancelRequested; | ||
} | ||
cancelStreaming() { | ||
this._cancelRequested = true; | ||
} | ||
} | ||
exports.StreamableScanPromise = StreamableScanPromise; |
@@ -58,3 +58,3 @@ { | ||
}, | ||
"version": "4.2.5", | ||
"version": "4.2.6-dev", | ||
"config": { | ||
@@ -84,15 +84,14 @@ "native": false | ||
"optionalDependencies": { | ||
"@couchbase/couchbase-darwin-arm64-openssl1": "4.2.5", | ||
"@couchbase/couchbase-darwin-arm64-openssl3": "4.2.5", | ||
"@couchbase/couchbase-darwin-x64-openssl1": "4.2.5", | ||
"@couchbase/couchbase-darwin-x64-openssl3": "4.2.5", | ||
"@couchbase/couchbase-linux-arm64-openssl1": "4.2.5", | ||
"@couchbase/couchbase-linux-arm64-openssl3": "4.2.5", | ||
"@couchbase/couchbase-linux-x64-openssl1": "4.2.5", | ||
"@couchbase/couchbase-linux-x64-openssl3": "4.2.5", | ||
"@couchbase/couchbase-linuxmusl-x64-openssl1": "4.2.5", | ||
"@couchbase/couchbase-linuxmusl-x64-openssl3": "4.2.5", | ||
"@couchbase/couchbase-win32-x64-openssl1": "4.2.5", | ||
"@couchbase/couchbase-win32-x64-openssl3": "4.2.5" | ||
"@couchbase/couchbase-darwin-arm64-openssl1": "4.2.6-dev", | ||
"@couchbase/couchbase-darwin-arm64-openssl3": "4.2.6-dev", | ||
"@couchbase/couchbase-darwin-x64-openssl1": "4.2.6-dev", | ||
"@couchbase/couchbase-darwin-x64-openssl3": "4.2.6-dev", | ||
"@couchbase/couchbase-linux-arm64-openssl1": "4.2.6-dev", | ||
"@couchbase/couchbase-linux-x64-openssl1": "4.2.6-dev", | ||
"@couchbase/couchbase-linux-x64-openssl3": "4.2.6-dev", | ||
"@couchbase/couchbase-linuxmusl-x64-openssl1": "4.2.6-dev", | ||
"@couchbase/couchbase-linuxmusl-x64-openssl3": "4.2.6-dev", | ||
"@couchbase/couchbase-win32-x64-openssl1": "4.2.6-dev", | ||
"@couchbase/couchbase-win32-x64-openssl3": "4.2.6-dev" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54234589
13
5261
110361
1