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: doc/man/cbc-n1qlback.1
+53-6Lines changed: 53 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
.\" generated with Ronn/v0.7.3
2
2
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
.
4
-
.TH "CBC\-N1QLBACK" "1" "April 2019" "" ""
4
+
.TH "CBC\-N1QLBACK" "1" "December 2020" "" ""
5
5
.
6
6
.SH "NAME"
7
7
\fBcbc\-n1qlback\fR\- Stress Test for Couchbase Query (N1QL)
@@ -30,6 +30,32 @@
30
30
For more complex queries (for example, placeholders, custom options), you may refer to the N1QL REST API reference\.
31
31
.
32
32
.P
33
+
For example, the following line shows how to use named parameter
34
+
.
35
+
.IP""4
36
+
.
37
+
.nf
38
+
39
+
{"statement":"SELECT RAW meta()\.id FROM `travel\-sample` WHERE type=$type LIMIT 1", "$type":"airline"}
40
+
.
41
+
.fi
42
+
.
43
+
.IP""0
44
+
.
45
+
.P
46
+
There is also special query option, \fB"n1qlback"\fR, which is stripped before sending the payload\. Currently it allows to tell if the particular query must be prepared before execution:
47
+
.
48
+
.IP""4
49
+
.
50
+
.nf
51
+
52
+
{"statement":"SELECT * FROM `travel\-sample` WHERE type=$type LIMIT 10", "$type":"airline", "n1qlback": {"prepare": true}}
53
+
.
54
+
.fi
55
+
.
56
+
.IP""0
57
+
.
58
+
.P
33
59
\fBn1qlback\fR requires that any resources (data items, indexes) are already defined\.
34
60
.
35
61
.SH "OPTIONS"
@@ -176,16 +202,37 @@ The following will create a file with 3 queries and 5 threads alternating betwee
176
202
.
177
203
.nf
178
204
179
-
cbc n1ql \-U couchbase://192\.168\.72\.101/a_bucket \'CREATE INDEX ix_name ON `travel\-sample`(name)\'
180
-
cbc n1ql \-U couchbase://192\.168\.72\.101/a_bucket \'CREATE INDEX ix_country ON `travel\-sample`(country)\'
205
+
cbc n1ql \'CREATE INDEX ix_name ON `travel\-sample`(name)\'
206
+
cbc n1ql \'CREATE INDEX ix_country ON `travel\-sample`(country)\'
207
+
.
208
+
.fi
209
+
.
210
+
.IP""0
211
+
.
212
+
.P
213
+
Crete text file \fBqueries\.txt\fR with the following content (note that fourth query has parameter)
214
+
.
215
+
.IP""4
216
+
.
217
+
.nf
181
218
182
-
cat queries\.txt <<EOF
183
219
{"statement":"SELECT country FROM `travel\-sample` WHERE `travel\-sample`\.country = \e"United States\e""}
184
220
{"statement":"SELECT name FROM `travel\-sample` LIMIT 10"}
185
221
{"statement":"SELECT country, COUNT(country) FROM `travel\-sample` GROUP BY country"}
186
-
EOF
222
+
{"statement":"SELECT RAW meta()\.id FROM `travel\-sample` WHERE type=$type LIMIT 1", "$type":"airline", "n1qlback": {"prepare": true}}
0 commit comments