Activate Mongo Proxy in Prod (#1936)

* activate mongo proxy in mpac

* activate mongo proxy in mpac

* activate mongo proxy in prod

* fixed parition key unit test

* remove three part partition key value test

---------

Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
Asier Isayas 2024-08-14 14:15:11 -04:00 committed by GitHub
parent 24860a6842
commit cc89691da3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 17 deletions

View File

@ -676,7 +676,7 @@ export function useMongoProxyEndpoint(api: string): boolean {
const activeMongoProxyEndpoints: string[] = [ const activeMongoProxyEndpoints: string[] = [
MongoProxyEndpoints.Local, MongoProxyEndpoints.Local,
MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Mpac,
// MongoProxyEndpoints.Prod, MongoProxyEndpoints.Prod,
// MongoProxyEndpoints.Fairfax, // MongoProxyEndpoints.Fairfax,
]; ];
let canAccessMongoProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled"; let canAccessMongoProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled";

View File

@ -147,21 +147,5 @@ describe("Query Utils", () => {
expect(expectedPartitionKeyValues).toContain(documentContent["Type"]); expect(expectedPartitionKeyValues).toContain(documentContent["Type"]);
expect(expectedPartitionKeyValues).toContain(documentContent["Status"]); expect(expectedPartitionKeyValues).toContain(documentContent["Status"]);
}); });
it("should extract three partition key values", () => {
const multiPartitionKeyDefinition: PartitionKeyDefinition = {
kind: PartitionKeyKind.MultiHash,
paths: ["/Country", "/Region", "/Category"],
};
const expectedPartitionKeyValues: string[] = ["United States", "US-Washington", ""];
const partitioinKeyValues: PartitionKey[] = extractPartitionKeyValues(
documentContent,
multiPartitionKeyDefinition,
);
expect(partitioinKeyValues.length).toBe(3);
expect(expectedPartitionKeyValues).toContain(documentContent["Country"]);
expect(expectedPartitionKeyValues).toContain(documentContent["Region"]);
expect(expectedPartitionKeyValues).toContain(documentContent["Category"]);
});
}); });
}); });