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
There are several minor but notable behavior differences between _N1QL for Mobile_ queries and _N1QL for Server_, as shown in <<tbl-diffs>>.
21
+
There are several minor but notable behavior differences between _{sqlpp} for Mobile_ queries and _{sqlpp} for Server_, as shown in <<tbl-diffs>>.
20
22
21
-
In some instances, if required, you can force N1QL for Mobile to work in the same way as N1QL for Server.
23
+
In some instances, if required, you can force {sqlpp} for Mobile to work in the same way as {sqlpp} for Server.
22
24
These instances are noted in the content below.
23
25
24
-
.N1QL Query Comparison
26
+
.{sqlpp} Query Comparison
25
27
[#tbl-diffs, cols="^1,2a,2a, options="header"]
26
28
|===
27
29
28
30
|
29
-
2+^h|N1QL Comparison
31
+
2+^h|{sqlpp} Comparison
30
32
31
33
h| Feature
32
-
h| N1QL for Couchbase Server
33
-
h| N1QL for Mobile
34
+
h| {sqlpp} for Couchbase Server
35
+
h| {sqlpp} for Mobile
34
36
35
37
| USE KEYS
36
38
| SELECT fname, email FROM tutorial USE KEYS ["dave", "ian"];
@@ -85,7 +87,7 @@ ON KEYS ARRAY s.order_id FOR s IN u.order_history END;
85
87
| Only scalar values may be compared
86
88
87
89
| ORDER BY
88
-
|Result sequencing is based on specific rules described in {svr-n1ql-reference-orderby--xref}
90
+
|Result sequencing is based on specific rules described in {svr-{sqlpp}-reference-orderby--xref}
89
91
|Result sequencing is based on the SQLite ordering described in https://sqlite.org/lang_select.html[SQLite select overview]
90
92
91
93
The ordering of _Dictionary_ and _Array_ objects is based on binary ordering.
@@ -108,7 +110,7 @@ The ordering of _Dictionary_ and _Array_ objects is based on binary ordering.
108
110
109
111
[,cols="1a,1a", options="header"]
110
112
|===
111
-
^| N1QL for Couchbase Server ^| N1QL for Mobile
113
+
^| {sqlpp} for Couchbase Server ^| {sqlpp} for Mobile
112
114
113
115
114
116
|Couchbase Server operates in the same way as Couchbase Lite, except:
@@ -118,9 +120,9 @@ The ordering of _Dictionary_ and _Array_ objects is based on binary ordering.
118
120
* Empty strings, arrays, and objects are FALSE
119
121
* All other values are TRUE
120
122
121
-
You can choose to use _Couchbase Server's N1QL rules_ by using the `TOBOOLEAN(expr)` function to convert a value to its boolean value.
123
+
You can choose to use _Couchbase Server's {sqlpp} rules_ by using the `TOBOOLEAN(expr)` function to convert a value to its boolean value.
122
124
123
-
|N1QL for Mobile's boolean logic rules are based on SQLite’s, so:
125
+
|{sqlpp} for Mobile's boolean logic rules are based on SQLite’s, so:
124
126
125
127
* TRUE is TRUE, and FALSE is FALSE
126
128
* Numbers 0 or 0.0 are FALSE
@@ -134,11 +136,11 @@ You can choose to use _Couchbase Server's N1QL rules_ by using the `TOBOOLEAN(ex
134
136
135
137
=== Logical Operations
136
138
137
-
In N1QL for Mobile logical operations will return one of three possible values; `TRUE`, `FALSE`, or `MISSING`.
139
+
In {sqlpp} for Mobile logical operations will return one of three possible values; `TRUE`, `FALSE`, or `MISSING`.
138
140
139
141
Logical operations with the `MISSING` value could result in `TRUE` or `FALSE` if the result can be determined regardless of the missing value, otherwise the result will be `MISSING`.
140
142
141
-
In N1QL for Mobile -- unlike N1QL for Server -- `NULL` is implicitly converted to `FALSE` before evaluating logical operations.
143
+
In {sqlpp} for Mobile -- unlike {sqlpp} for Server -- `NULL` is implicitly converted to `FALSE` before evaluating logical operations.
142
144
<<tbl-logops>> summarizes the result of logical operations with different operand values and also shows where the Couchbase Server behavior differs.
143
145
144
146
.Logical Operations Comparison
@@ -147,8 +149,8 @@ In N1QL for Mobile -- unlike N1QL for Server -- `NULL` is implicitly converted t
147
149
148
150
.2+.>h| Operand +
149
151
a
150
-
3+h| N1QL for Mobile
151
-
3+h| N1QL for Server
152
+
3+h| {sqlpp} for Mobile
153
+
3+h| {sqlpp} for Server
152
154
153
155
h| b
154
156
h| a AND b
@@ -296,21 +298,21 @@ h| a OR b
296
298
|===
297
299
298
300
== CRUD Operations
299
-
N1QL for Mobile only supports Read or Query operations.
301
+
{sqlpp} for Mobile only supports Read or Query operations.
300
302
301
-
N1QL for Server fully supports CRUD operation.
303
+
{sqlpp} for Server fully supports CRUD operation.
302
304
303
305
== Functions
304
306
305
307
=== Division Operator
306
308
307
309
[,colse="1a,1a", options="header"]
308
310
|===
309
-
^| N1QL for Server ^| N1QL for Mobile
311
+
^| {sqlpp} for Server ^| {sqlpp} for Mobile
310
312
311
-
| N1QL for Server always performs float division regardless of the types of the operands.
313
+
| {sqlpp} for Server always performs float division regardless of the types of the operands.
312
314
313
-
You can force this behavior in N1QL for Mobile by using the `DIV(x, y)` function.
315
+
You can force this behavior in {sqlpp} for Mobile by using the `DIV(x, y)` function.
314
316
315
317
|The operand types determine the
316
318
division operation performed. +
@@ -322,9 +324,9 @@ If one is a floating number, then float division is used.
322
324
=== Round Function
323
325
[,cols="1a,1a", options="header"]
324
326
|===
325
-
^| N1QL for Server ^| N1QL for Mobile
327
+
^| {sqlpp} for Server ^| {sqlpp} for Mobile
326
328
327
-
| N1QL for Server `ROUND()` uses the _Rounding to Nearest Even_ convention (for example, `ROUND(1.85)` returns 1.8).
329
+
| {sqlpp} for Server `ROUND()` uses the _Rounding to Nearest Even_ convention (for example, `ROUND(1.85)` returns 1.8).
328
330
329
331
You can force this behavior in Couchbase Lite by using the `ROUND_EVEN()` function.
330
332
@@ -337,4 +339,4 @@ You can force this behavior in Couchbase Lite by using the `ROUND_EVEN()` functi
337
339
338
340
339
341
340
-
// END --- inclusion -- common-query-n1ql-mobile.adoc
342
+
// END --- inclusion -- common-query-{sqlpp}-mobile.adoc
@@ -25,18 +25,18 @@ NOTE: The examples used in this topic are based on the _Travel Sample_ app and d
25
25
26
26
== Introduction
27
27
28
-
Developers using Couchbase Lite for {param-title} can provide N1QL query strings using the N1QL Query API.
28
+
Developers using Couchbase Lite for {param-title} can provide {sqlpp} query strings using the {sqlpp} Query API.
29
29
This API uses query statements of the form shown in <<ex-query-form>>.
30
30
31
-
The structure and semantics of the query format are based on that of Couchbase Server's N1QL query language -- see {svr-n1ql-reference--xref} and {svr-n1ql-datamodel--xref}.
31
+
The structure and semantics of the query format are based on that of Couchbase Server's {sqlpp} query language -- see {svr-n1ql-reference--xref} and {svr-n1ql-datamodel--xref}.
32
32
33
33
34
34
== Running
35
35
36
-
Use the N1QLQuery class to define the N1QL query string on the database to be queried.
36
+
Use the N1QLQuery class to define the {sqlpp} query string on the database to be queried.
37
37
Then run the query using the`.execute()` method -- see {query-resultsets--xref} for how to work with result sets.
@@ -76,7 +76,7 @@ The `SELECT`ed properties of documents matching this criteria will be returned i
76
76
<.> <<lbl-offset>> specifies the number of results to be skipped before starting to return results
77
77
====
78
78
79
-
TIP: We recommend working through the {url-n1ql-tutorial} as a good way to build your N1QL skills.
79
+
TIP: We recommend working through the {url-n1ql-tutorial} as a good way to build your {sqlpp} skills.
80
80
81
81
82
82
@@ -118,12 +118,12 @@ You can use the wildcard *** to select all columns -- see <<Select Wildcard>>
118
118
<.> Use the optional `AS` argument to provides an alias name for a property. Each property can be aliased by putting the `AS <alias name>` after the column name.
119
119
120
120
==== Select Wildcard
121
-
When using the `SELECT *` option the column name (key) of the N1QL string is one of:
121
+
When using the `SELECT *` option the column name (key) of the {sqlpp} string is one of:
122
122
123
123
* The alias name if one was specified
124
124
* The data source name (or its alias if provided) as specified in the `FROM` clause.
125
125
126
-
This behavior is inline with that of Couchbase Server N1QL -- see example in <<tbl-selstar>>.
126
+
This behavior is inline with that of Couchbase Server {sqlpp} -- see example in <<tbl-selstar>>.
127
127
128
128
129
129
.Example Column Names for SELECT ***
@@ -1126,7 +1126,7 @@ This is different from Server N1QL, where:
1126
1126
* Empty strings, arrays, and objects are FALSE
1127
1127
* All other values are TRUE
1128
1128
1129
-
TIP: Use TOBOOLEAN(expr) function to convert a value based on Server N1QL boolean value rules,
1129
+
TIP: Use TOBOOLEAN(expr) function to convert a value based on Server {sqlpp} boolean value rules,
1130
1130
--
1131
1131
1132
1132
.Logical Operators
@@ -1244,7 +1244,7 @@ If an operand is NULL, the operation will result in NULL if the other operand is
1244
1244
|===
1245
1245
1246
1246
[NOTE]
1247
-
This differs from Server N1QL in the following instances: +
1247
+
This differs from Server {sqlpp} in the following instances: +
1248
1248
^5-1^ Server will return: NULL instead of FALSE +
1249
1249
^5-2^ Server will return: MISSING instead of FALSE +
1250
1250
^5-3^ Server will return: NULL instead of MISSING +
@@ -1743,7 +1743,7 @@ The function uses _Rounding to Nearest Even_ (Banker’s Rounding) convention wh
1743
1743
1744
1744
|===
1745
1745
1746
-
^*^ The behavior of the ROUND() function is different from Server N1QL ROUND(), which rounds the midpoint values using _Rounding to Nearest Even_ convention.
1746
+
^*^ The behavior of the ROUND() function is different from Server {sqlpp} ROUND(), which rounds the midpoint values using _Rounding to Nearest Even_ convention.
1747
1747
1748
1748
1749
1749
@@ -1952,7 +1952,7 @@ ifndef::is-c[]
1952
1952
// Section not valid for C
1953
1953
== QueryBuilder Differences
1954
1954
1955
-
Couchbase Lite N1QL Query supports all QueryBuilder features, except _Predictive Query_ and _Index_. See <<tbl-qbldr-diffs>> for the features supported by N1QL but not by QueryBuilder.
1955
+
Couchbase Lite {sqlpp} Query supports all QueryBuilder features, except _Predictive Query_ and _Index_. See <<tbl-qbldr-diffs>> for the features supported by {sqlpp} but not by QueryBuilder.
1956
1956
1957
1957
1958
1958
.QueryBuilder Differences
@@ -2013,11 +2013,11 @@ endif::is-c[]
2013
2013
[#lbl-query-params]
2014
2014
== Query Parameters
2015
2015
2016
-
You can provide runtime parameters to your N1QL query to make it more flexible.
2016
+
You can provide runtime parameters to your {sqlpp} query to make it more flexible.
2017
2017
2018
2018
To specify substitutable parameters within your query string prefix the name with *`$`*, `$type` -- see: <<ex-sample-params>>.
0 commit comments