Skip to content

Commit f76c456

Browse files
3.5 gradual updates
1 parent 52d0051 commit f76c456

2 files changed

Lines changed: 18 additions & 47 deletions

File tree

antora.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ asciidoc:
88
attributes:
99
server_version: '7.2'
1010
sdk_current_version: '3.5.0'
11-
sdk_dot_minor: 3.5.0
11+
sdk_dot_minor: 3.5
1212
sdk_dot_major: 3.x
1313
version-server: '7.2'
14+
version-common: '7.2'
1415
name_platform: 'Java'
1516
name-sdk: Java SDK
1617
sdk_api: '3.4'
Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,38 @@
11
= MapReduce Views
2-
:description: You can use MapReduce views to create queryable indexes in Couchbase Server.
2+
:description: Our legacy MapReduce Views Service is best replaced by the scalable Query Service.
3+
:navtitle: MapReduce Views
34
:page-topic-type: howto
4-
:page-aliases: ROOT:view-queries-with-sdk
5+
:page-aliases: ROOT:view-queries-with-sdk,ROOT:geo-spatial-views
56

67
include::project-docs:partial$attributes.adoc[]
78

89
[abstract]
910
{description}
1011

1112
// include::{version-common}@sdk:shared:partial$views.adoc[tag=deprecate]
12-
include::{version-common}@sdk:shared:partial$views.adoc[tag=deprecate]
1313

1414

15-
include::{version-common}@sdk:shared:partial$views.adoc[tag=views-intro]
15+
// option 1 - C++ - redirect to migration page, and add note at end.
1616

17-
== Querying Views
17+
// option 2 - most others - this common page, with per-sdk archive link at end.
1818

19-
View operations are accessible on the `Bucket` API.
20-
Once you have a reference to the bucket you need to at least supply the name of the design document and the name of the view:
2119

22-
[source,java]
23-
----
24-
include::example$Views.java[tag=views-simple,indent=0]
25-
----
2620

27-
It is important to remember that by default, the SDK will look for a view deployed to the production namespace.
28-
If you want to query one which is still in the development namespace you can do it like this:
21+
////
22+
Views are a legacy service which pre-dates the {name-sdk}.
23+
Your use case is most likely to be met by the xref:howtos:n1ql-queries-with-sdk.adoc[Query service].
24+
////
2925

30-
[source,java]
31-
----
32-
include::example$Views.java[tag=views-dev,indent=0]
33-
----
26+
xref:{version-server}@server:learn:views/views-intro.adoc[MapReduce Views] date from the earliest days of Couchbase and although still maintained and supported for legacy use, they are deprecated in Couchbase Server, and will eventually be removed.
3427

35-
In the same way you can supply all kinds of different options, including the `ViewScanConsistency` which was previously called `Stale`.
28+
Views are the only service which does not benefit from xref:{version-server}@server:learn:services-and-indexes/services/services.adoc#services-and-multi-dimensional-scaling[Multi-Dimensional Scaling], and is rarely the best choice over, say, xref:howtos:n1ql-queries-with-sdk.adoc[our Query service] if you are starting a fresh application.
29+
See our discussion document on xref:concept-docs:data-services.adoc[the best service for you to use].
3630

37-
[source,java]
38-
----
39-
include::example$Views.java[tag=views-opts,indent=0]
40-
----
31+
CAUTION: If you are provisioning Views on Couchbase Server for a legacy application, _they must run on a
32+
xref:{version-server}@server:learn:buckets-memory-and-storage/storage-engines.adoc#couchstore[couchstore] bucket_.
4133

42-
If you have a `reduce` function in your view and you want to call it, make sure to call `.reduce(true)` as well.
4334

44-
== Working with View Rows
35+
We will maintain support for Views in the SDKs for so long as it can be used with a supported version of Couchbase Server.
4536

46-
A `ViewResult` can emit 0 to N view rows.
47-
The available data inside each `ViewRow` depends both on the map function written and if a reduce function is used.
37+
Information on using MapReduce Views with the SDK can still be accessed in our https://docs-archive.couchbase.com/java-sdk/3.1/howtos/view-queries-with-sdk.html[documentation archive].
4838

49-
The structure of a `ViewRow` looks like this:
50-
51-
[source,java]
52-
----
53-
include::example$Views.java[tag=view_rows_structure,indent=0]
54-
----
55-
56-
Both the `key` and the `value` can be converted into any target type, depending on how you wrote your view function.
57-
Note that the document ID is always a `String`, but it is wrapped in an `Optional` because it is not available if a reduce function is used.
58-
59-
== Accessing View Metadata
60-
61-
In addition to the rows the view result contains additional `ViewMetaData`.
62-
63-
[source,java]
64-
----
65-
include::example$Views.java[tag=views-meta,indent=0]
66-
----
67-
68-
The number of rows is always present, the debug information only if you enable it on the `ViewOptions` as indicated through being wrapped into an `Optional<JsonObject>`.

0 commit comments

Comments
 (0)