UNPKG

2.38 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.BinaryCollection = void 0;
4/**
5 * Exposes a number of binary-level operations against a collection.
6 * These operations do not adhere to the standard JSON-centric
7 * behaviour of the SDK.
8 *
9 * @category Core
10 */
11class BinaryCollection {
12 /**
13 * @internal
14 */
15 constructor(parent) {
16 this._coll = parent;
17 }
18 /**
19 * Increments the ASCII value of the specified key by the amount
20 * indicated in the delta parameter.
21 *
22 * @param key The key to increment.
23 * @param delta The amount to increment the key.
24 * @param options Optional parameters for this operation.
25 * @param callback A node-style callback to be invoked after execution.
26 */
27 increment(key, delta, options, callback) {
28 return this._coll._binaryIncrement(key, delta, options, callback);
29 }
30 /**
31 * Decrements the ASCII value of the specified key by the amount
32 * indicated in the delta parameter.
33 *
34 * @param key The key to increment.
35 * @param delta The amount to increment the key.
36 * @param options Optional parameters for this operation.
37 * @param callback A node-style callback to be invoked after execution.
38 */
39 decrement(key, delta, options, callback) {
40 return this._coll._binaryDecrement(key, delta, options, callback);
41 }
42 /**
43 * Appends the specified value to the end of the specified key.
44 *
45 * @param key The key to append to.
46 * @param value The value to adjoin to the end of the document.
47 * @param options Optional parameters for this operation.
48 * @param callback A node-style callback to be invoked after execution.
49 */
50 append(key, value, options, callback) {
51 return this._coll._binaryAppend(key, value, options, callback);
52 }
53 /**
54 * Prepends the specified value to the beginning of the specified key.
55 *
56 * @param key The key to prepend to.
57 * @param value The value to adjoin to the beginning of the document.
58 * @param options Optional parameters for this operation.
59 * @param callback A node-style callback to be invoked after execution.
60 */
61 prepend(key, value, options, callback) {
62 return this._coll._binaryPrepend(key, value, options, callback);
63 }
64}
65exports.BinaryCollection = BinaryCollection;