* Pushes the queries and parameters represented by this instance to the provided array. * @internal * @ignore * @param {Array} arr * @return {Promise<{isIdempotent, isCounter}>}
(arr)
| 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. |
no test coverage detected