MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / pushQueries

Method pushQueries

lib/mapping/model-batch-item.js:83–100  ·  view source on GitHub ↗

* Pushes the queries and parameters represented by this instance to the provided array. * @internal * @ignore * @param {Array} arr * @return {Promise<{isIdempotent, isCounter}>}

(arr)

Source from the content-addressed store, hash-verified

81 * @return {Promise<{isIdempotent, isCounter}>}
82 */
83 pushQueries(arr) {
84 let isIdempotent = true;
85 let isCounter;
86
87 return this.getQueries().then(queries => {
88 queries.forEach(q => {
89 // It's idempotent if all the queries contained are idempotent
90 isIdempotent = isIdempotent && q.isIdempotent;
91
92 // Either all queries are counter mutation or we let it fail at server level
93 isCounter = q.isCounter;
94
95 arr.push({ query: q.query, params: q.paramsGetter(this.doc, this.docInfo, this.getMappingInfo()) });
96 });
97
98 return { isIdempotent, isCounter };
99 });
100 }
101
102 /**
103 * Gets the mapping information for this batch item.

Callers 1

batchMethod · 0.80

Calls 4

getQueriesMethod · 0.95
getMappingInfoMethod · 0.95
forEachMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected