Revert "Pk missing fix (#2094)" (#2099)

This reverts commit af0a890516.
This commit is contained in:
sunghyunkang1111
2025-04-09 13:04:44 -05:00
committed by GitHub
parent 0666e11d89
commit a3bfc89318
8 changed files with 21 additions and 259 deletions

View File

@@ -47,7 +47,6 @@ export function buildDocumentsQueryPartitionProjections(
for (const index in partitionKey.paths) {
// TODO: Handle "/" in partition key definitions
const projectedProperties: string[] = partitionKey.paths[index].split("/").slice(1);
const isSystemPartitionKey: boolean = partitionKey.systemKey || false;
let projectedProperty = "";
projectedProperties.forEach((property: string) => {
@@ -62,13 +61,8 @@ export function buildDocumentsQueryPartitionProjections(
projectedProperty += `[${projection}]`;
}
});
const fullAccess = `${collectionAlias}${projectedProperty}`;
if (!isSystemPartitionKey) {
const wrappedProjection = `IIF(IS_DEFINED(${fullAccess}), ${fullAccess}, {})`;
projections.push(wrappedProjection);
} else {
projections.push(fullAccess);
}
projections.push(`${collectionAlias}${projectedProperty}`);
}
return projections.join(",");
@@ -124,7 +118,7 @@ export const extractPartitionKeyValues = (
documentContent: any,
partitionKeyDefinition: PartitionKeyDefinition,
): PartitionKey[] => {
if (!partitionKeyDefinition.paths || partitionKeyDefinition.paths.length === 0 || partitionKeyDefinition.systemKey) {
if (!partitionKeyDefinition.paths || partitionKeyDefinition.paths.length === 0) {
return undefined;
}
@@ -136,8 +130,6 @@ export const extractPartitionKeyValues = (
if (value !== undefined) {
partitionKeyValues.push(value);
} else {
partitionKeyValues.push({});
}
});