fix partition key missing not being able to load the document (#2085)

This commit is contained in:
sunghyunkang1111
2025-03-26 11:26:47 -05:00
committed by GitHub
parent 41f5401016
commit 257256f915
3 changed files with 76 additions and 14 deletions

View File

@@ -61,8 +61,9 @@ export function buildDocumentsQueryPartitionProjections(
projectedProperty += `[${projection}]`;
}
});
projections.push(`${collectionAlias}${projectedProperty}`);
const fullAccess = `${collectionAlias}${projectedProperty}`;
const wrappedProjection = `IIF(IS_DEFINED(${fullAccess}), ${fullAccess}, {})`;
projections.push(wrappedProjection);
}
return projections.join(",");
@@ -130,6 +131,8 @@ export const extractPartitionKeyValues = (
if (value !== undefined) {
partitionKeyValues.push(value);
} else {
partitionKeyValues.push({});
}
});