/var/www/qr4y.gr/server/delivery/node_modules/@google-cloud/firestore/build/src
NameSizeModeActions
v1/-0755rm
v1beta1/-0755rm
backoff.d.ts55470644editdlrm
backoff.js76500644editdlrm
bulk-writer.d.ts192410644editdlrm
bulk-writer.js360760644editdlrm
bundle.d.ts8350644editdlrm
bundle.js84270644editdlrm
collection-group.d.ts36100644editdlrm
collection-group.js45200644editdlrm
convert.d.ts27760644editdlrm
convert.js71670644editdlrm
document-change.d.ts50410644editdlrm
document-change.js52920644editdlrm
document-reader.d.ts18420644editdlrm
document-reader.js53530644editdlrm
document.d.ts181360644editdlrm
document.js304110644editdlrm
field-value.d.ts86180644editdlrm
field-value.js139040644editdlrm
geo-point.d.ts26440644editdlrm
geo-point.js32170644editdlrm
index.d.ts365110644editdlrm
index.js594210644editdlrm
logger.d.ts13100644editdlrm
logger.js21120644editdlrm
order.d.ts10960644editdlrm
order.js75250644editdlrm
path.d.ts121260644editdlrm
path.js190030644editdlrm
pool.d.ts41160644editdlrm
pool.js88590644editdlrm
query-partition.d.ts40190644editdlrm
query-partition.js57690644editdlrm
rate-limiter.d.ts30150644editdlrm
rate-limiter.js58500644editdlrm
recursive-delete.d.ts57140644editdlrm
recursive-delete.js100100644editdlrm
reference.d.ts456100644editdlrm
reference.js894490644editdlrm
serializer.d.ts29420644editdlrm
serializer.js128130644editdlrm
status-code.d.ts11210644editdlrm
status-code.js7120644editdlrm
timestamp.d.ts69870644editdlrm
timestamp.js96970644editdlrm
transaction.d.ts96730644editdlrm
transaction.js188890644editdlrm
types.d.ts38690644editdlrm
types.js13870644editdlrm
util.d.ts34630644editdlrm
util.js60230644editdlrm
validate.d.ts65270644editdlrm
validate.js123140644editdlrm
watch.d.ts97620644editdlrm
watch.js249720644editdlrm
write-batch.d.ts105330644editdlrm
write-batch.js272340644editdlrm
Edit: /var/www/qr4y.gr/server/delivery/node_modules/@google-cloud/firestore/build/src/query-partition.js (5769B)
"use strict"; /* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryPartition = void 0; const reference_1 = require("./reference"); const path_1 = require("./path"); const serializer_1 = require("./serializer"); /** * A split point that can be used in a query as a starting and/or end point for * the query results. The cursors returned by {@link #startAt} and {@link * #endBefore} can only be used in a query that matches the constraint of query * that produced this partition. * * @class QueryPartition */ class QueryPartition { /** @hideconstructor */ constructor(_firestore, _collectionId, _converter, _startAt, _endBefore) { this._firestore = _firestore; this._collectionId = _collectionId; this._converter = _converter; this._startAt = _startAt; this._endBefore = _endBefore; this._serializer = new serializer_1.Serializer(_firestore); } /** * The cursor that defines the first result for this partition or `undefined` * if this is the first partition. The cursor value must be * destructured when passed to `startAt()` (for example with * `query.startAt(...queryPartition.startAt)`). * * @example * ``` * const query = firestore.collectionGroup('collectionId'); * for await (const partition of query.getPartitions(42)) { * let partitionedQuery = query.orderBy(FieldPath.documentId()); * if (partition.startAt) { * partitionedQuery = partitionedQuery.startAt(...partition.startAt); * } * if (partition.endBefore) { * partitionedQuery = partitionedQuery.endBefore(...partition.endBefore); * } * const querySnapshot = await partitionedQuery.get(); * console.log(`Partition contained ${querySnapshot.length} documents`); * } * * ``` * @type {Array<*>} * @return {Array<*>} A cursor value that can be used with {@link * Query#startAt} or `undefined` if this is the first partition. */ get startAt() { if (this._startAt && !this._memoizedStartAt) { this._memoizedStartAt = this._startAt.map(v => this._serializer.decodeValue(v)); } return this._memoizedStartAt; } /** * The cursor that defines the first result after this partition or * `undefined` if this is the last partition. The cursor value must be * destructured when passed to `endBefore()` (for example with * `query.endBefore(...queryPartition.endBefore)`). * * @example * ``` * const query = firestore.collectionGroup('collectionId'); * for await (const partition of query.getPartitions(42)) { * let partitionedQuery = query.orderBy(FieldPath.documentId()); * if (partition.startAt) { * partitionedQuery = partitionedQuery.startAt(...partition.startAt); * } * if (partition.endBefore) { * partitionedQuery = partitionedQuery.endBefore(...partition.endBefore); * } * const querySnapshot = await partitionedQuery.get(); * console.log(`Partition contained ${querySnapshot.length} documents`); * } * * ``` * @type {Array<*>} * @return {Array<*>} A cursor value that can be used with {@link * Query#endBefore} or `undefined` if this is the last partition. */ get endBefore() { if (this._endBefore && !this._memoizedEndBefore) { this._memoizedEndBefore = this._endBefore.map(v => this._serializer.decodeValue(v)); } return this._memoizedEndBefore; } /** * Returns a query that only encapsulates the documents for this partition. * * @example * ``` * const query = firestore.collectionGroup('collectionId'); * for await (const partition of query.getPartitions(42)) { * const partitionedQuery = partition.toQuery(); * const querySnapshot = await partitionedQuery.get(); * console.log(`Partition contained ${querySnapshot.length} documents`); * } * * ``` * @return {Query} A query partitioned by a {@link Query#startAt} and * {@link Query#endBefore} cursor. */ toQuery() { // Since the api.Value to JavaScript type conversion can be lossy (unless // `useBigInt` is used), we pass the original protobuf representation to the // created query. let queryOptions = reference_1.QueryOptions.forCollectionGroupQuery(this._collectionId, this._converter); queryOptions = queryOptions.with({ fieldOrders: [new reference_1.FieldOrder(path_1.FieldPath.documentId())], }); if (this._startAt !== undefined) { queryOptions = queryOptions.with({ startAt: { before: true, values: this._startAt }, }); } if (this._endBefore !== undefined) { queryOptions = queryOptions.with({ endAt: { before: true, values: this._endBefore }, }); } return new reference_1.Query(this._firestore, queryOptions); } } exports.QueryPartition = QueryPartition; //# sourceMappingURL=query-partition.js.map