This repository was archived by the owner on Dec 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,35 @@ FOR i IN 1..1000
129
129
IN users OPTIONS { exclusive: true }
130
130
```
131
131
132
+ ### ` indexHint `
133
+
134
+ The ` indexHint ` option will be used as a hint for the document lookup
135
+ performed as part of the ` UPSERT ` operation, and can help in cases such as
136
+ ` UPSERT ` not picking the best index automatically.
137
+
138
+ ``` js
139
+ UPSERT { a: 1234 }
140
+ INSERT { a: 1234 , name: " AB" }
141
+ UPDATE { name: " ABC" } IN myCollection
142
+ OPTIONS { indexHint: " index_name" }
143
+ ```
144
+
145
+ The index hint is passed through to an internal ` FOR ` loop that is used for the
146
+ lookup. Also see [ ` indexHint ` Option of the ` FOR ` Operation] ( operations-for.html#indexhint ) .
147
+
148
+ ### ` forceIndexHint `
149
+
150
+ Makes the index or indices specified in ` indexHint ` mandatory if enabled. The
151
+ default is ` false ` . Also see
152
+ [ ` forceIndexHint ` Option of the ` FOR ` Operation] ( operations-for.html#forceindexhint ) .
153
+
154
+ ``` js
155
+ UPSERT { a: 1234 }
156
+ INSERT { a: 1234 , name: " AB" }
157
+ UPDATE { name: " ABC" } IN myCollection
158
+ OPTIONS { indexHint: … , forceIndexHint: true }
159
+ ```
160
+
132
161
Returning documents
133
162
-------------------
134
163
Original file line number Diff line number Diff line change @@ -97,6 +97,22 @@ and later used as a condition for `FILTER`.
97
97
98
98
See [ Pruning] ( aql/graphs-traversals.html#pruning )
99
99
100
+ ### Upsert with Index Hint
101
+
102
+ Added support for the ` indexHint ` and ` forceIndexHint ` options to the ` UPSERT `
103
+ operation. It will be used as a hint for the document lookup that is performed
104
+ as part of the ` UPSERT ` operation, and can help in cases such as ` UPSERT ` not
105
+ picking the best index automatically.
106
+
107
+ ``` js
108
+ UPSERT { a: 1234 }
109
+ INSERT { a: 1234 , name: " AB" }
110
+ UPDATE {name: " ABC" } IN myCollection
111
+ OPTIONS { indexHint: " index_name" , forceIndexHint: true }
112
+ ```
113
+
114
+ See [ ` UPSERT ` Options] ( aql/operations-upsert.html#indexhint )
115
+
100
116
### Decay Functions
101
117
102
118
Added three decay functions to AQL:
You can’t perform that action at this time.
0 commit comments