@azure/cosmos
Version:
Microsoft Azure Cosmos DB Service Node.js SDK for NOSQL API
39 lines • 1.16 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* Creates an OrderByQueryContinuationToken
* @hidden
*/
export function createOrderByQueryContinuationToken(rangeMappings, orderByItems, rid, skipCount, documentRid, offset, limit, hashedLastResult) {
if (!rangeMappings || rangeMappings.length === 0) {
throw new Error("rangeMappings must contain at least one element");
}
if (!orderByItems || orderByItems.length === 0) {
throw new Error("orderByItems must contain at least one element");
}
return {
rangeMappings,
orderByItems,
rid,
skipCount,
documentRid,
offset,
limit,
hashedLastResult,
};
}
/**
* Serializes an OrderByQueryContinuationToken to a JSON string
* @hidden
*/
export function serializeOrderByQueryContinuationToken(token) {
return JSON.stringify(token);
}
/**
* Deserializes a JSON string to an OrderByQueryContinuationToken
* @hidden
*/
export function parseOrderByQueryContinuationToken(tokenString) {
return JSON.parse(tokenString);
}
//# sourceMappingURL=OrderByQueryContinuationToken.js.map