firestore_composite_index_config.tf 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. # Copyright 2024 Google LLC
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. locals {
  15. indexes = {
  16. index1 = [
  17. {
  18. field_path = "testId"
  19. order = "ASCENDING"
  20. },
  21. {
  22. field_path = "a"
  23. order = "ASCENDING"
  24. },
  25. ]
  26. index2 = [
  27. {
  28. field_path = "testId"
  29. order = "ASCENDING"
  30. },
  31. {
  32. field_path = "b"
  33. order = "ASCENDING"
  34. },
  35. ]
  36. index3 = [
  37. {
  38. field_path = "testId"
  39. order = "ASCENDING"
  40. },
  41. {
  42. field_path = "b"
  43. order = "DESCENDING"
  44. },
  45. ]
  46. index4 = [
  47. {
  48. field_path = "a"
  49. order = "ASCENDING"
  50. },
  51. {
  52. field_path = "testId"
  53. order = "ASCENDING"
  54. },
  55. {
  56. field_path = "b"
  57. order = "ASCENDING"
  58. },
  59. ]
  60. index5 = [
  61. {
  62. field_path = "a"
  63. order = "ASCENDING"
  64. },
  65. {
  66. field_path = "testId"
  67. order = "ASCENDING"
  68. },
  69. {
  70. field_path = "b"
  71. order = "DESCENDING"
  72. },
  73. ]
  74. index6 = [
  75. {
  76. field_path = "a"
  77. order = "ASCENDING"
  78. },
  79. {
  80. field_path = "testId"
  81. order = "ASCENDING"
  82. },
  83. {
  84. field_path = "a"
  85. order = "DESCENDING"
  86. },
  87. ]
  88. index7 = [
  89. {
  90. field_path = "b"
  91. order = "ASCENDING"
  92. },
  93. {
  94. field_path = "testId"
  95. order = "ASCENDING"
  96. },
  97. {
  98. field_path = "a"
  99. order = "ASCENDING"
  100. },
  101. ]
  102. index8 = [
  103. {
  104. field_path = "b"
  105. order = "ASCENDING"
  106. },
  107. {
  108. field_path = "testId"
  109. order = "ASCENDING"
  110. },
  111. {
  112. field_path = "a"
  113. order = "DESCENDING"
  114. },
  115. ]
  116. index9 = [
  117. {
  118. field_path = "testId"
  119. order = "ASCENDING"
  120. },
  121. {
  122. field_path = "a"
  123. order = "ASCENDING"
  124. },
  125. {
  126. field_path = "b"
  127. order = "ASCENDING"
  128. },
  129. ]
  130. index10 = [
  131. {
  132. field_path = "testId"
  133. order = "ASCENDING"
  134. },
  135. {
  136. field_path = "b"
  137. order = "DESCENDING"
  138. },
  139. {
  140. field_path = "a"
  141. order = "DESCENDING"
  142. },
  143. ]
  144. index11 = [
  145. {
  146. field_path = "testId"
  147. order = "ASCENDING"
  148. },
  149. {
  150. field_path = "pages"
  151. order = "ASCENDING"
  152. },
  153. {
  154. field_path = "year"
  155. order = "ASCENDING"
  156. },
  157. ]
  158. index12 = [
  159. {
  160. field_path = "testId"
  161. order = "ASCENDING"
  162. },
  163. {
  164. field_path = "pages"
  165. order = "ASCENDING"
  166. },
  167. {
  168. field_path = "rating"
  169. order = "ASCENDING"
  170. },
  171. {
  172. field_path = "year"
  173. order = "ASCENDING"
  174. },
  175. ]
  176. index13 = [
  177. {
  178. field_path = "rating"
  179. array_config = "CONTAINS"
  180. },
  181. {
  182. field_path = "testId"
  183. order = "ASCENDING"
  184. },
  185. {
  186. field_path = "pages"
  187. order = "ASCENDING"
  188. },
  189. {
  190. field_path = "rating"
  191. order = "ASCENDING"
  192. },
  193. ]
  194. index14 = [
  195. {
  196. field_path = "testId"
  197. order = "ASCENDING"
  198. },
  199. {
  200. field_path = "key"
  201. order = "ASCENDING"
  202. },
  203. {
  204. field_path = "sort"
  205. order = "ASCENDING"
  206. }
  207. ]
  208. index15 = [
  209. {
  210. field_path = "testId"
  211. order = "ASCENDING"
  212. },
  213. {
  214. field_path = "key"
  215. order = "ASCENDING"
  216. },
  217. {
  218. field_path = "sort"
  219. order = "ASCENDING"
  220. },
  221. {
  222. field_path = "v"
  223. order = "ASCENDING"
  224. }
  225. ]
  226. index16 = [
  227. {
  228. field_path = "testId"
  229. order = "ASCENDING"
  230. },
  231. {
  232. field_path = "v"
  233. order = "DESCENDING"
  234. },
  235. {
  236. field_path = "key"
  237. order = "DESCENDING"
  238. },
  239. {
  240. field_path = "sort"
  241. order = "DESCENDING"
  242. },
  243. ]
  244. index17 = [
  245. {
  246. field_path = "v"
  247. array_config = "CONTAINS"
  248. },
  249. {
  250. field_path = "testId"
  251. order = "ASCENDING"
  252. },
  253. {
  254. field_path = "key"
  255. order = "ASCENDING"
  256. },
  257. {
  258. field_path = "sort"
  259. order = "ASCENDING"
  260. },
  261. ]
  262. index18 = [
  263. {
  264. field_path = "key"
  265. order = "ASCENDING"
  266. },
  267. {
  268. field_path = "testId"
  269. order = "ASCENDING"
  270. },
  271. {
  272. field_path = "sort"
  273. order = "DESCENDING"
  274. },
  275. {
  276. field_path = "v"
  277. order = "ASCENDING"
  278. },
  279. ]
  280. index19 = [
  281. {
  282. field_path = "testId"
  283. order = "ASCENDING"
  284. },
  285. {
  286. field_path = "sort"
  287. order = "DESCENDING"
  288. },
  289. {
  290. field_path = "key"
  291. order = "ASCENDING"
  292. },
  293. {
  294. field_path = "v"
  295. order = "ASCENDING"
  296. },
  297. ]
  298. index20 = [
  299. {
  300. field_path = "testId"
  301. order = "ASCENDING"
  302. },
  303. {
  304. field_path = "v"
  305. order = "ASCENDING"
  306. },
  307. {
  308. field_path = "sort"
  309. order = "ASCENDING"
  310. },
  311. {
  312. field_path = "key"
  313. order = "ASCENDING"
  314. },
  315. ]
  316. index21 = [
  317. {
  318. field_path = "testId"
  319. order = "ASCENDING"
  320. },
  321. {
  322. field_path = "sort"
  323. order = "DESCENDING"
  324. },
  325. {
  326. field_path = "key"
  327. order = "DESCENDING"
  328. },
  329. ]
  330. index22 = [
  331. {
  332. field_path = "testId"
  333. order = "ASCENDING"
  334. },
  335. {
  336. field_path = "v"
  337. order = "DESCENDING"
  338. },
  339. {
  340. field_path = "sort"
  341. order = "ASCENDING"
  342. },
  343. {
  344. field_path = "key"
  345. order = "ASCENDING"
  346. },
  347. ]
  348. index23 = [
  349. {
  350. field_path = "testId"
  351. order = "ASCENDING"
  352. },
  353. {
  354. field_path = "name"
  355. order = "ASCENDING"
  356. },
  357. {
  358. field_path = "metadata.createdAt"
  359. order = "ASCENDING"
  360. },
  361. ]
  362. index24 = [
  363. {
  364. field_path = "testId"
  365. order = "ASCENDING"
  366. },
  367. {
  368. field_path = "name"
  369. order = "DESCENDING"
  370. },
  371. {
  372. field_path = "field"
  373. order = "DESCENDING"
  374. },
  375. {
  376. field_path = "`field.dot`"
  377. order = "DESCENDING"
  378. },
  379. {
  380. field_path = "`field\\\\slash`"
  381. order = "DESCENDING"
  382. },
  383. ],
  384. index25 = [
  385. {
  386. field_path = "testId"
  387. order = "ASCENDING"
  388. },
  389. {
  390. field_path = "v"
  391. order = "ASCENDING"
  392. },
  393. {
  394. field_path = "key"
  395. order = "ASCENDING"
  396. },
  397. {
  398. field_path = "sort"
  399. order = "ASCENDING"
  400. },
  401. ]
  402. }
  403. }