Ignore IIF statements if emulators

This commit is contained in:
Sung-Hyun Kang
2025-10-21 16:06:39 -05:00
parent 3e86a6be9d
commit 2194bb4961

View File

@@ -1,4 +1,5 @@
import { PartitionKey, PartitionKeyDefinition } from "@azure/cosmos";
import { configContext, Platform } from "ConfigContext";
import { getRUThreshold, ruThresholdEnabled } from "Shared/StorageUtility";
import { userContext } from "UserContext";
import { logConsoleWarning } from "Utils/NotificationConsoleUtils";
@@ -66,7 +67,11 @@ export function buildDocumentsQueryPartitionProjections(
}
});
const fullAccess = `${collectionAlias}${projectedProperty}`;
if (!isSystemPartitionKey) {
if (
!isSystemPartitionKey &&
configContext.platform !== Platform.Emulator &&
configContext.platform !== Platform.VNextEmulator
) {
const wrappedProjection = `IIF(IS_DEFINED(${fullAccess}), ${fullAccess}, {})`;
projections.push(wrappedProjection);
} else {