Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-7049: Remove 6.5.1 sidebars from server docs #1446

Merged
merged 2 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 10 additions & 55 deletions modules/n1ql/pages/n1ql-language-reference/insert.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ If you assign an alias to the keyspace reference, the `AS` keyword may be omitte

[subs="normal"]
----
insert-values ::= [ "(" [ PRIMARY ] KEY , VALUE ")" ] <<values-clause,values-clause>>
insert-values ::= [ "(" [ PRIMARY ] KEY "," VALUE [ "," OPTIONS ] ")" ] <<values-clause,values-clause>>
----

image::n1ql-language-reference/insert-values.png["( '(' 'PRIMARY'? 'KEY' ',' 'VALUE' ')' )? values-clause"]
image::n1ql-language-reference/insert-values.png["( '(' 'PRIMARY'? 'KEY' ',' 'VALUE' ( ',' 'OPTIONS' )? ')' )? values-clause"]

Specifies one or more documents to be inserted using the VALUES clause.
Each document requires a unique key and the values must be specified as well-formed JSON.
Expand All @@ -149,31 +149,18 @@ The bracketed KEY and VALUE keywords are purely a visual mnemonic to indicate th
There is no syntactic requirement to include these keywords when using the Insert Values syntax.
Also note that there is no syntactic difference between PRIMARY KEY and KEY.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the Insert Values syntax supports an optional third keyword `OPTIONS`.

[subs="normal"]
----
insert-values ::= [ "(" [ PRIMARY ] KEY "," VALUE [ "," OPTIONS ] ")" ] <<values-clause,values-clause>>
----

image::n1ql-language-reference/insert-values-651.png["( '(' 'PRIMARY'? 'KEY' ',' 'VALUE' ( ',' 'OPTIONS' )? ')' )? values-clause"]

Again, the `OPTIONS` keyword is purely a visual mnemonic to indicate that you are setting metadata for the inserted document.
There is no syntactic requirement to include the `OPTIONS` keyword when setting metadata for the inserted document.
****
Similarly, the OPTIONS keyword is purely a visual mnemonic to indicate that you are setting metadata for the inserted document.
There is no syntactic requirement to include the OPTIONS keyword when setting metadata for the inserted document.

[[values-clause]]
==== VALUES Clause

[subs="normal"]
----
values-clause ::= VALUES "(" _key_ "," _value_ ")" [ "," [ VALUES ] "(" _key_ "," _value_ ")" ]{asterisk}
values-clause ::= VALUES "(" _key_ "," _value_ [ "," _options_ ] ")" [ "," [ VALUES ] "(" _key_ "," _value_ [ "," _options_ ] ")" ]{asterisk}
----

image::n1ql-language-reference/values-clause.png["'VALUES' '(' key ',' value ')' ( ',' 'VALUES'? '(' key ',' value ')' )*"]
image::n1ql-language-reference/values-clause.png["'VALUES' '(' key ',' value ( ',' options )? ')' ( ',' 'VALUES'? '(' key ',' value ( ',' options )? ')' )*"]

key::
A string, or an expression resolving to a string, representing the ID of the document to be inserted.
Expand All @@ -185,27 +172,14 @@ A JSON object or value, or an expression resolving to a JSON object or value, re
(See http://json.org/example.html[^] for examples of well-formed JSON.)
You can insert NULL, empty, or MISSING values.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the VALUES clause supports an optional third argument, `__options__`.

[subs="normal"]
----
values-clause ::= VALUES "(" _key_ "," _value_ [ "," _options_ ] ")" [ "," [ VALUES ] "(" _key_ "," _value_ [ "," _options_ ] ")" ]{asterisk}
----

image::n1ql-language-reference/values-clause-651.png["'VALUES' '(' key ',' value ( ',' options )? ')' ( ',' 'VALUES'? '(' key ',' value ( ',' options )? ')' )*"]

options::
[Optional] An object representing the metadata to be set for the inserted document.
Only the `expiration` attribute has any effect; any other attributes are ignored.

expiration:::
An integer, or an expression resolving to an integer, representing the xref:3.0@java-sdk:howtos:kv-operations.adoc#document-expiration[document expiration] in seconds.

+
If the document expiration is not specified, it defaults to `0`, meaning the document expiration is the same as the xref:learn:buckets-memory-and-storage/expiration.adoc[bucket expiration].
****

[[example-2]]
.Specify a key using an expression
Expand Down Expand Up @@ -351,8 +325,6 @@ INSERT INTO `travel-sample` (KEY, VALUE)
[[example-7a]]
.Insert a document with expiration
====
[.status]#Couchbase Server 6.5.1#

Insert a document into the `travel-sample` bucket using an expiration of 5 days.

.Query
Expand All @@ -374,10 +346,10 @@ For more examples illustrating the variations of the values-clause, see <<insert

[subs="normal"]
----
insert-select ::= "(" [ PRIMARY ] KEY _key_ [ "," VALUE _value_ ] ")" <<select-statement,select>>
insert-select ::= "(" [ PRIMARY ] KEY _key_ [ "," VALUE _value_ ] [ "," OPTIONS _options_ ] ")" <<select-statement,select>>
----

image::n1ql-language-reference/insert-select.png["'(' 'PRIMARY'? 'KEY' key ( ',' 'VALUE' value )? ')' select"]
image::n1ql-language-reference/insert-select.png["'(' 'PRIMARY'? 'KEY' key ( ',' 'VALUE' value )? ( ',' 'OPTIONS' options )? ')' select"]

Use the projection of a SELECT statement which generates well-formed JSON to insert.

Expand All @@ -390,27 +362,14 @@ value::
This may be an alias assigned by the SELECT statement.
If the VALUE is omitted, the entire JSON document generated by the SELECT statement is inserted.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the Insert Select syntax supports an optional third keyword `OPTIONS` and an associated argument `__options__`.

[subs="normal"]
----
insert-select ::= "(" [ PRIMARY ] KEY _key_ [ "," VALUE _value_ ] [ "," OPTIONS _options_ ] ")" <<select-statement,select>>
----

image::n1ql-language-reference/insert-select-651.png["'(' 'PRIMARY'? 'KEY' key ( ',' 'VALUE' value )? ( ',' 'OPTIONS' options )? ')' select"]

options::
[Optional] An object representing the metadata to be set for the inserted document.
Only the `expiration` attribute has any effect; any other attributes are ignored.

expiration:::
An integer, or an expression resolving to an integer, representing the xref:3.0@java-sdk:howtos:kv-operations.adoc#document-expiration[document expiration] in seconds.

+
If the document expiration is not specified, it defaults to `0`, meaning the document expiration is the same as the xref:learn:buckets-memory-and-storage/expiration.adoc[bucket expiration].
****

[[select-statement]]
==== SELECT Statement
Expand Down Expand Up @@ -460,8 +419,6 @@ RETURNING *;
[[example-8a]]
.Insert with SELECT and set expiration
====
[.status]#Couchbase Server 6.5.1#

Query the `travel-sample` bucket for documents of `type` "airport" and `airportname` "Heathrow", and then insert the projection into the `travel-sample` bucket using a unique key and an expiration of 2 hours.

.Query
Expand All @@ -476,8 +433,6 @@ INSERT INTO `travel-sample` (KEY UUID(), VALUE doc, OPTIONS {"expiration": 2*60*
[[example-8b]]
.Insert with SELECT and preserve expiration
====
[.status]#Couchbase Server 6.5.1#

If you want to copy the expiration of an existing document to the inserted document, you can use a xref:n1ql-language-reference/metafun.adoc#meta[META().expiration] expression in the SELECT statement, as shown here.

.Query
Expand Down
55 changes: 11 additions & 44 deletions modules/n1ql/pages/n1ql-language-reference/merge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ User executing the MERGE statement must have the following privileges:
For more details about user roles, refer to
xref:learn:security/authorization-overview.adoc[Authorization].

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, a user with the _Data Writer_ privilege may set documents to expire.
[NOTE]
A user with the _Data Writer_ privilege may set documents to expire.
When the document expires, the data service deletes the document, even though the user may not have the _Query Delete_ privilege.
****

== Syntax

Expand Down Expand Up @@ -284,28 +281,15 @@ Updates a document that already exists with updated values.

[subs="normal"]
----
set-clause ::= SET <<ansi-path,path>> '=' _expr_ [ <<ansi-update-for,update-for>> ] [ ',' <<ansi-path,path>> '=' _expr_ [ <<ansi-update-for,update-for>> ] ]*
set-clause ::= SET ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) [ ',' ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) ]*
----

image::n1ql-language-reference/set-clause.png["'SET' path '=' expr update-for? (',' path '=' expr update-for?)*"]
image::n1ql-language-reference/set-clause.png["'SET' ( meta '=' expiration | path '=' expr update-for? ) ( ',' ( meta '=' expiration | path '=' expr update-for? ) )*"]

Specifies the value for an attribute to be changed.
For more details, refer to xref:n1ql-language-reference/update.adoc#set-clause[SET Clause].

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the SET clause also supports alternative arguments which enable you to set the expiration of the document.

[subs="normal"]
----
set-clause ::= SET ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) [ ',' ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) ]*
----

image::n1ql-language-reference/set-clause-651.png["'SET' ( meta '=' expiration | path '=' expr update-for? ) ( ',' ( meta '=' expiration | path '=' expr update-for? ) )*"]
Also enables you to set the expiration of the document.

For more details, refer to xref:n1ql-language-reference/update.adoc#set-clause[SET Clause].
****

[id="ansi-unset-clause"]
===== UNSET Clause
Expand Down Expand Up @@ -386,10 +370,10 @@ For more details, refer to xref:n1ql-language-reference/update.adoc#where-clause

[subs="normal"]
----
ansi-merge-insert ::= WHEN NOT MATCHED THEN INSERT '(' [ KEY ] _key_ [ ',' [ VALUE ] _value_ ] ')' [ <<ansi-insert-where>> ]
ansi-merge-insert ::= WHEN NOT MATCHED THEN INSERT '(' [ KEY ] _key_ [ ',' [ VALUE ] _value_ ] [ ',' [ OPTIONS ] _options_ ] ')' [ <<ansi-insert-where>> ]
----

image::n1ql-language-reference/ansi-merge-insert.png["'WHEN' 'NOT' 'MATCHED' 'THEN' 'INSERT' '(' 'KEY'? key ( ',' 'VALUE'? value )? ')' where-clause?"]
image::n1ql-language-reference/ansi-merge-insert.png["'WHEN' 'NOT' 'MATCHED' 'THEN' 'INSERT' '(' 'KEY'? key ( ',' 'VALUE'? value )? ( ',' 'OPTIONS'? options )? ')' where-clause?"]

Inserts a new document into the keyspace.
Use parentheses to specify the key and value for the inserted document, separated by a comma.
Expand All @@ -409,30 +393,18 @@ If the value is omitted, an empty document is inserted.
The `VALUE` keyword may be omitted.
If it is omitted, the `KEY` keyword must be omitted also.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the ANSI Merge Insert syntax supports an optional third keyword `OPTIONS` and an associated argument `__options__`.

[subs="normal"]
----
ansi-merge-insert ::= WHEN NOT MATCHED THEN INSERT '(' [ KEY ] _key_ [ ',' [ VALUE ] _value_ ] [ ',' [ OPTIONS ] _options_ ] ')' [ <<ansi-insert-where>> ]
----

image::n1ql-language-reference/ansi-merge-insert-651.png["'WHEN' 'NOT' 'MATCHED' 'THEN' 'INSERT' '(' 'KEY'? key ( ',' 'VALUE'? value )? ( ',' 'OPTIONS'? options )? ')' where-clause?"]

options::
[Optional] An object representing the metadata to be set for the inserted document.
Only the `expiration` attribute has any effect; any other attributes are ignored.

expiration:::
An integer, or an expression resolving to an integer, representing the xref:3.0@java-sdk:howtos:kv-operations.adoc#document-expiration[document expiration] in seconds.

+
If the document expiration is not specified, it defaults to `0`, meaning the document expiration is the same as the xref:learn:buckets-memory-and-storage/expiration.adoc[bucket expiration].

+
The `OPTIONS` keyword may be omitted.
If it is omitted, the `KEY` and `VALUE` keywords must be omitted also.
****

[[ansi-insert-where,where-clause]]
===== WHERE Clause
Expand Down Expand Up @@ -560,12 +532,9 @@ The key specified in the <<lookup-merge-predicate,Lookup Merge Predicate>> is us

expr:: An expression specifying the value for the inserted document.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the Lookup Merge Insert syntax does not enable you to specify the document expiration.
[NOTE]
The Lookup Merge Insert syntax does not enable you to specify the document expiration.
If you need to specify the document expiration, rewrite the query using the ANSI Merge Insert syntax.
****

[[lookup-merge-insert-where]]
===== WHERE Clause
Expand Down Expand Up @@ -684,8 +653,6 @@ WHEN NOT MATCHED THEN
[[example-4]]
.ANSI merge with expiration
====
[.status]#Couchbase Server 6.5.1#

This example compares a source set of airport data with the `travel-sample` airport data.
If the airport already exists in `travel-sample`, the record is updated, and the existing document expiration is preserved.
If the airport does not exist in `travel-sample`, a new record is created with an expiration of one week.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ The following keywords are reserved and cannot be used as unescaped identifiers:
| xref:n1ql-language-reference/offset.adoc[OFFSET]
| ON
| OPTION
| xref:n1ql-language-reference/insert.adoc#insert-values[OPTIONS] footnote:[Couchbase Server 6.5.1 and later.]
| xref:n1ql-language-reference/insert.adoc#insert-values[OPTIONS]
| xref:n1ql-language-reference/logicalops.adoc#or-operator[OR]
| xref:n1ql-language-reference/orderby.adoc[ORDER]

Expand Down
37 changes: 7 additions & 30 deletions modules/n1ql/pages/n1ql-language-reference/update.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ WHERE lower(city) = "sanfrancisco"
RETURNING *
----

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, a user with the _Data Writer_ privilege may set documents to expire.
[NOTE]
A user with the _Data Writer_ privilege may set documents to expire.
When the document expires, the data service deletes the document, even though the user may not have the _Query Delete_ privilege.
****

== Syntax

Expand Down Expand Up @@ -112,10 +109,10 @@ For details, refer to xref:n1ql-language-reference/hints.adoc#use-keys-clause[US

[subs="normal"]
----
set-clause ::= SET _path_ '=' _expr_ [ <<update-for,update-for>> ] [ ',' _path_ '=' _expr_ [ <<update-for,update-for>> ] ]*
set-clause ::= SET ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) [ ',' ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) ]*
----

image::n1ql-language-reference/set-clause.png["'SET' path '=' expr update-for? (',' path '=' expr update-for?)*"]
image::n1ql-language-reference/set-clause.png["'SET' ( meta '=' expiration | path '=' expr update-for? ) ( ',' ( meta '=' expiration | path '=' expr update-for? ) )*"]

Specifies the value for an attribute to be changed.

Expand All @@ -125,17 +122,7 @@ A <<path,path>> specifying the attribute to be changed.
expr::
The value may be a generic expression term, a subquery, or an expression that resolves to nested array elements.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, the SET clause also supports alternative arguments which enable you to set the expiration of the document.

[subs="normal"]
----
set-clause ::= SET ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) [ ',' ( _meta_ '=' _expiration_ | _path_ '=' _expr_ [ <<update-for,update-for>> ] ) ]*
----

image::n1ql-language-reference/set-clause-651.png["'SET' ( meta '=' expiration | path '=' expr update-for? ) ( ',' ( meta '=' expiration | path '=' expr update-for? ) )*"]
The SET clause also supports alternative arguments which enable you to set the expiration of the document.

meta::
A xref:n1ql-language-reference/metafun.adoc#meta[META().expiration] expression specifying the expiration property of the document being updated.
Expand All @@ -144,7 +131,6 @@ expiration::
An integer, or an expression resolving to an integer, representing the xref:3.0@java-sdk:howtos:kv-operations.adoc#document-expiration[document expiration] in seconds.

If the document expiration is not specified, it defaults to `0`, meaning the document expiration is the same as the xref:learn:buckets-memory-and-storage/expiration.adoc[bucket expiration].
****

[[unset-clause]]
=== UNSET Clause
Expand All @@ -161,12 +147,9 @@ Removes the specified attribute from the document.
path::
A <<path,path>> specifying the attribute to be removed.

****
[.status]#Couchbase Server 6.5.1#

In Couchbase Server 6.5.1, you cannot use the UNSET clause to unset the document expiration.
[NOTE]
You cannot use the UNSET clause to unset the document expiration.
To unset the document expiration, you can either set the document expiration to `0`, or simply update the document without specifying the document expiration.
****

[[update-for]]
=== FOR Clause
Expand Down Expand Up @@ -454,8 +437,6 @@ RETURNING a;
[[example-7]]
.Update a document and set expiration
====
[.status]#Couchbase Server 6.5.1#

Update a document and set the expiration to 1 week.

.Query
Expand All @@ -470,8 +451,6 @@ s.codeshare = NULL FOR s IN schedule END;
[[example-8]]
.Update a document and preserve expiration
====
[.status]#Couchbase Server 6.5.1#

.Query
[source,n1ql]
----
Expand All @@ -484,8 +463,6 @@ s.codeshare = NULL FOR s IN schedule END;
[[example-9]]
.Update a document and unset expiration
====
[.status]#Couchbase Server 6.5.1#

Set the document expiration to 0 to unset the document expiration.
(In this case, the document expiration defaults to be the same as the bucket expiration.)

Expand Down