You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/helpers.asciidoc
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,9 +162,10 @@ scroll_helper.clear
162
162
--
163
163
164
164
[discrete]
165
+
[[esql-helper]]
165
166
=== ES|QL Helper
166
167
167
-
This helpers provides an Object response from the ESQL `query` API instead of the default JSON value.
168
+
This helper provides an object response from the ESQL `query` API instead of the default JSON value.
168
169
169
170
To use the ES|QL helper, require it in your code:
170
171
@@ -203,7 +204,7 @@ puts response
203
204
]}
204
205
----
205
206
206
-
The helper returns an Array of hashes with the columns as keys and the respective values. So for the previous example, it would return the following:
207
+
The helper returns an array of hashes with the columns as keys and the respective values. So for the previous example, it would return the following:
207
208
208
209
[source,ruby]
209
210
----
@@ -222,7 +223,7 @@ puts response
222
223
]
223
224
----
224
225
225
-
Additionally, a block can be specified to work on the response data. Pass in a block to `query` and it will yield each item in the Array of responses.
226
+
Additionally, a block can be specified to transform the response data. Pass in a block to `query` and it will yield each item in the array of responses.
226
227
227
228
You could use this for example to convert '@timestamp' into a DateTime object:
0 commit comments