Skip to content

Commit 0bb84a4

Browse files
author
Adrian Hall
committed
(#204) Updated composite index settings to support the Cosmos live controller tests.
1 parent 0fd7f37 commit 0bb84a4

File tree

1 file changed

+83
-14
lines changed

1 file changed

+83
-14
lines changed

infra/modules/cosmos.bicep

Lines changed: 83 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,88 @@ param tags object = {}
2020

2121
/*********************************************************************************/
2222

23+
var compositeIndices = [
24+
[
25+
{ path: '/BestPictureWinner', order: 'ascending' }
26+
{ path: '/id', order: 'ascending' }
27+
]
28+
[
29+
{ path: '/BestPictureWinner', order: 'descending' }
30+
{ path: '/id', order: 'ascending' }
31+
]
32+
[
33+
{ path: '/Duration', order: 'ascending' }
34+
{ path: '/id', order: 'ascending' }
35+
]
36+
[
37+
{ path: '/Duration', order: 'descending' }
38+
{ path: '/id', order: 'ascending' }
39+
]
40+
[
41+
{ path: '/Rating', order: 'ascending' }
42+
{ path: '/id', order: 'ascending' }
43+
]
44+
[
45+
{ path: '/Rating', order: 'descending' }
46+
{ path: '/id', order: 'ascending' }
47+
]
48+
[
49+
{ path: '/ReleaseDate', order: 'ascending' }
50+
{ path: '/id', order: 'ascending' }
51+
]
52+
[
53+
{ path: '/ReleaseDate', order: 'descending' }
54+
{ path: '/id', order: 'ascending' }
55+
]
56+
[
57+
{ path: '/Title', order: 'ascending' }
58+
{ path: '/id', order: 'ascending' }
59+
]
60+
[
61+
{ path: '/Title', order: 'descending' }
62+
{ path: '/id', order: 'ascending' }
63+
]
64+
[
65+
{ path: '/UpdatedAt', order: 'ascending' }
66+
{ path: '/id', order: 'ascending' }
67+
]
68+
[
69+
{ path: '/UpdatedAt', order: 'descending' }
70+
{ path: '/id', order: 'ascending' }
71+
]
72+
[
73+
{ path: '/Year', order: 'ascending' }
74+
{ path: '/id', order: 'ascending' }
75+
]
76+
[
77+
{ path: '/Year', order: 'descending' }
78+
{ path: '/id', order: 'ascending' }
79+
]
80+
[
81+
{ path: '/Year', order: 'ascending' }
82+
{ path: '/Title', order: 'ascending' }
83+
{ path: '/id', order: 'ascending' }
84+
]
85+
[
86+
{ path: '/Year', order: 'descending' }
87+
{ path: '/Title', order: 'ascending' }
88+
{ path: '/id', order: 'ascending' }
89+
]
90+
[
91+
{ path: '/Year', order: 'ascending' }
92+
{ path: '/Title', order: 'descending' }
93+
{ path: '/id', order: 'ascending' }
94+
]
95+
[
96+
{ path: '/Year', order: 'descending' }
97+
{ path: '/Title', order: 'descending' }
98+
{ path: '/id', order: 'ascending' }
99+
]
100+
]
101+
102+
/*********************************************************************************/
103+
104+
23105
resource cosmos_account 'Microsoft.DocumentDB/databaseAccounts@2024-02-15-preview' = {
24106
name: serverName
25107
location: location
@@ -70,20 +152,7 @@ resource cosmos_container 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/co
70152
excludedPaths: [
71153
{ path: '/_etag/?' }
72154
]
73-
compositeIndexes: [
74-
[
75-
{ path: '/UpdatedAt', order: 'ascending' }
76-
{ path: '/id', order: 'ascending' }
77-
]
78-
[
79-
{ path: '/Title', order: 'ascending' }
80-
{ path: '/id', order: 'ascending' }
81-
]
82-
[
83-
{ path: '/Title', order: 'descending' }
84-
{ path: '/id', order: 'ascending' }
85-
]
86-
]
155+
compositeIndexes: compositeIndices
87156
}
88157
defaultTtl: 86400
89158
}

0 commit comments

Comments
 (0)