mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 08:51:24 +00:00
This reverts commit af0a890516.
This commit is contained in:
@@ -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({});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user