couchbase 4.2.10 → 4.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/deps/couchbase-cxx-client/CMakeLists.txt +1 -0
  2. package/deps/couchbase-cxx-client/cmake/ThirdPartyDependencies.cmake +2 -0
  3. package/deps/couchbase-cxx-client/core/bucket.cxx +25 -10
  4. package/deps/couchbase-cxx-client/core/bucket.hxx +1 -0
  5. package/deps/couchbase-cxx-client/core/cluster.cxx +29 -3
  6. package/deps/couchbase-cxx-client/core/impl/collection.cxx +2 -2
  7. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
  8. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +7 -1
  9. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +10 -0
  10. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +35 -1
  11. package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +2 -0
  12. package/deps/couchbase-cxx-client/core/management/design_document.hxx +1 -1
  13. package/deps/couchbase-cxx-client/core/meta/features.hxx +16 -1
  14. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +1 -1
  15. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +1 -1
  16. package/deps/couchbase-cxx-client/core/operations/document_query.cxx +2 -2
  17. package/deps/couchbase-cxx-client/core/operations/document_search.cxx +10 -10
  18. package/deps/couchbase-cxx-client/core/operations/document_view.cxx +3 -0
  19. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  20. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +24 -13
  21. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -1
  22. package/deps/couchbase-cxx-client/core/origin.cxx +14 -0
  23. package/deps/couchbase-cxx-client/core/origin.hxx +6 -0
  24. package/deps/couchbase-cxx-client/core/protocol/status.cxx +2 -0
  25. package/deps/couchbase-cxx-client/core/protocol/status.hxx +1 -0
  26. package/deps/couchbase-cxx-client/core/range_scan_load_balancer.cxx +141 -0
  27. package/deps/couchbase-cxx-client/core/range_scan_load_balancer.hxx +64 -0
  28. package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +224 -336
  29. package/deps/couchbase-cxx-client/core/range_scan_orchestrator.hxx +5 -6
  30. package/deps/couchbase-cxx-client/core/range_scan_orchestrator_options.hxx +6 -4
  31. package/deps/couchbase-cxx-client/core/scan_result.hxx +1 -11
  32. package/deps/couchbase-cxx-client/core/topology/capabilities.hxx +70 -1
  33. package/deps/couchbase-cxx-client/core/topology/capabilities_fmt.hxx +30 -2
  34. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +1 -34
  35. package/deps/couchbase-cxx-client/core/topology/configuration_fmt.hxx +2 -2
  36. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +43 -20
  37. package/deps/couchbase-cxx-client/core/transactions/internal/exceptions_internal.hxx +5 -0
  38. package/deps/couchbase-cxx-client/couchbase/bucket.hxx +2 -2
  39. package/deps/couchbase-cxx-client/couchbase/cluster.hxx +1 -1
  40. package/deps/couchbase-cxx-client/couchbase/collection.hxx +1 -0
  41. package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +80 -11
  42. package/deps/couchbase-cxx-client/couchbase/error_context.hxx +1 -0
  43. package/deps/couchbase-cxx-client/couchbase/fmt/key_value_status_code.hxx +3 -1
  44. package/deps/couchbase-cxx-client/couchbase/get_links_analytics_options.hxx +2 -2
  45. package/deps/couchbase-cxx-client/couchbase/key_value_status_code.hxx +1 -0
  46. package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +6 -8
  47. package/deps/couchbase-cxx-client/couchbase/scope.hxx +1 -1
  48. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +2 -2
  49. package/deps/couchbase-cxx-client/couchbase/search_result.hxx +1 -1
  50. package/deps/couchbase-cxx-client/couchbase/subdocument_error_context.hxx +1 -0
  51. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +1 -1
  52. package/deps/couchbase-cxx-client/couchbase-sdk-cxx-black-duck-manifest.yaml +1 -0
  53. package/dist/binding.d.ts +24 -2
  54. package/dist/bindingutilities.d.ts +11 -3
  55. package/dist/bindingutilities.js +33 -7
  56. package/dist/couchbase.d.ts +1 -0
  57. package/dist/couchbase.js +1 -0
  58. package/dist/queryindexmanager.d.ts +4 -4
  59. package/dist/queryindexmanager.js +7 -7
  60. package/dist/scope.d.ts +21 -0
  61. package/dist/scope.js +34 -0
  62. package/dist/scopesearchindexmanager.d.ts +116 -0
  63. package/dist/scopesearchindexmanager.js +406 -0
  64. package/dist/sdspecs.js +10 -9
  65. package/dist/sdutils.d.ts +1 -0
  66. package/dist/sdutils.js +4 -0
  67. package/dist/searchexecutor.d.ts +3 -1
  68. package/dist/searchexecutor.js +9 -2
  69. package/dist/searchindexmanager.d.ts +58 -3
  70. package/dist/searchindexmanager.js +188 -104
  71. package/dist/viewexecutor.js +13 -9
  72. package/dist/viewindexmanager.d.ts +70 -7
  73. package/dist/viewindexmanager.js +236 -103
  74. package/dist/viewtypes.d.ts +26 -0
  75. package/dist/viewtypes.js +17 -1
  76. package/package.json +7 -7
  77. package/src/constants.cpp +1 -0
  78. package/src/jstocbpp_autogen.hpp +89 -7
  79. package/deps/couchbase-cxx-client/core/scan_options.hxx +0 -44
@@ -22,8 +22,8 @@
22
22
 
23
23
  #include <tl/expected.hpp>
24
24
 
25
- #include <memory>
26
- #include <optional>
25
+ #include <cstdint>
26
+ #include <system_error>
27
27
 
28
28
  namespace asio
29
29
  {
@@ -39,10 +39,10 @@ class scan_stream_manager
39
39
  {
40
40
  public:
41
41
  virtual ~scan_stream_manager() = default;
42
- virtual void stream_start_failed(std::int16_t node_id, bool fatal) = 0;
43
42
  virtual void stream_start_failed_awaiting_retry(std::int16_t node_id, std::uint16_t vbucket_id) = 0;
44
- virtual void stream_continue_failed(std::int16_t node_id, bool fatal) = 0;
45
- virtual void stream_completed(std::int16_t node_id) = 0;
43
+ virtual void stream_received_item(range_scan_item item) = 0;
44
+ virtual void stream_failed(std::int16_t node_id, std::uint16_t vbucket_id, std::error_code ec, bool fatal) = 0;
45
+ virtual void stream_completed(std::int16_t node_id, std::uint16_t vbucket_id) = 0;
46
46
  };
47
47
 
48
48
  class range_scan_orchestrator
@@ -61,5 +61,4 @@ class range_scan_orchestrator
61
61
  private:
62
62
  std::shared_ptr<range_scan_orchestrator_impl> impl_;
63
63
  };
64
-
65
64
  } // namespace couchbase::core
@@ -15,17 +15,16 @@
15
15
 
16
16
  #pragma once
17
17
 
18
- #include "scan_options.hxx"
18
+ #include "range_scan_options.hxx"
19
19
  #include "timeout_defaults.hxx"
20
20
 
21
21
  #include <couchbase/mutation_token.hxx>
22
22
  #include <couchbase/retry_strategy.hxx>
23
23
 
24
- #include <cinttypes>
24
+ #include <chrono>
25
+ #include <cstdint>
25
26
  #include <memory>
26
27
  #include <optional>
27
- #include <system_error>
28
- #include <variant>
29
28
  #include <vector>
30
29
 
31
30
  namespace couchbase
@@ -39,6 +38,9 @@ class request_span;
39
38
 
40
39
  namespace couchbase::core
41
40
  {
41
+ struct mutation_state {
42
+ std::vector<couchbase::mutation_token> tokens;
43
+ };
42
44
 
43
45
  struct range_scan_orchestrator_options {
44
46
  static constexpr std::uint16_t default_concurrency{ 1 };
@@ -15,26 +15,16 @@
15
15
 
16
16
  #pragma once
17
17
 
18
- #include "scan_options.hxx"
19
-
18
+ #include "range_scan_options.hxx"
20
19
  #include "utils/movable_function.hxx"
21
20
 
22
- #include <couchbase/mutation_token.hxx>
23
- #include <couchbase/retry_strategy.hxx>
24
-
25
21
  #include <tl/expected.hpp>
26
22
 
27
- #include <cinttypes>
28
23
  #include <future>
29
- #include <memory>
30
- #include <optional>
31
24
  #include <system_error>
32
- #include <variant>
33
- #include <vector>
34
25
 
35
26
  namespace couchbase::core
36
27
  {
37
-
38
28
  class scan_result_impl;
39
29
 
40
30
  class range_scan_item_iterator
@@ -17,6 +17,8 @@
17
17
 
18
18
  #pragma once
19
19
 
20
+ #include <set>
21
+
20
22
  namespace couchbase::core
21
23
  {
22
24
  enum class bucket_capability {
@@ -32,8 +34,15 @@ enum class bucket_capability {
32
34
  durable_write,
33
35
  tombstoned_user_xattrs,
34
36
  range_scan,
35
- replica_read,
36
37
  non_deduped_history,
38
+ subdoc_replace_body_with_xattr,
39
+ subdoc_document_macro_support,
40
+ subdoc_revive_document,
41
+ dcp_ignore_purged_tombstones,
42
+ preserve_expiry,
43
+ query_system_collection,
44
+ mobile_system_collection,
45
+ subdoc_replica_read,
37
46
  };
38
47
 
39
48
  enum class cluster_capability {
@@ -43,5 +52,65 @@ enum class cluster_capability {
43
52
  n1ql_inline_functions,
44
53
  n1ql_enhanced_prepared_statements,
45
54
  n1ql_read_from_replica,
55
+ search_vector_search,
56
+ search_scoped_search_index,
57
+ };
58
+
59
+ struct configuration_capabilities {
60
+ std::set<bucket_capability> bucket{};
61
+ std::set<cluster_capability> cluster{};
62
+
63
+ [[nodiscard]] bool has_cluster_capability(cluster_capability cap) const
64
+ {
65
+ return cluster.find(cap) != cluster.end();
66
+ }
67
+
68
+ [[nodiscard]] bool has_bucket_capability(bucket_capability cap) const
69
+ {
70
+ return bucket.find(cap) != bucket.end();
71
+ }
72
+
73
+ [[nodiscard]] bool supports_enhanced_prepared_statements() const
74
+ {
75
+ return has_cluster_capability(cluster_capability::n1ql_enhanced_prepared_statements);
76
+ }
77
+
78
+ [[nodiscard]] bool supports_read_from_replica() const
79
+ {
80
+ return has_cluster_capability(cluster_capability::n1ql_read_from_replica);
81
+ }
82
+
83
+ [[nodiscard]] bool supports_range_scan() const
84
+ {
85
+ return has_bucket_capability(bucket_capability::range_scan);
86
+ }
87
+
88
+ [[nodiscard]] bool ephemeral() const
89
+ {
90
+ // Use bucket capabilities to identify if couchapi is missing (then its ephemeral). If its null then
91
+ // we are running an old version of couchbase which doesn't have ephemeral buckets at all.
92
+ return has_bucket_capability(bucket_capability::couchapi);
93
+ }
94
+
95
+ [[nodiscard]] bool supports_subdoc_read_replica() const
96
+ {
97
+ return has_bucket_capability(bucket_capability::subdoc_replica_read);
98
+ }
99
+
100
+ [[nodiscard]] bool supports_non_deduped_history() const
101
+ {
102
+ return has_bucket_capability(bucket_capability::non_deduped_history);
103
+ }
104
+
105
+ [[nodiscard]] bool supports_scoped_search_indexes() const
106
+ {
107
+ return has_cluster_capability(cluster_capability::search_scoped_search_index);
108
+ }
109
+
110
+ [[nodiscard]] bool supports_vector_search() const
111
+ {
112
+ return has_cluster_capability(cluster_capability::search_vector_search);
113
+ }
46
114
  };
115
+
47
116
  } // namespace couchbase::core
@@ -70,12 +70,33 @@ struct fmt::formatter<couchbase::core::bucket_capability> {
70
70
  case couchbase::core::bucket_capability::range_scan:
71
71
  name = "range_scan";
72
72
  break;
73
- case couchbase::core::bucket_capability::replica_read:
74
- name = "replica_read";
73
+ case couchbase::core::bucket_capability::subdoc_replica_read:
74
+ name = "subdoc_replica_read";
75
75
  break;
76
76
  case couchbase::core::bucket_capability::non_deduped_history:
77
77
  name = "non_deduped_history";
78
78
  break;
79
+ case couchbase::core::bucket_capability::subdoc_replace_body_with_xattr:
80
+ name = "subdoc_replace_body_with_xattr";
81
+ break;
82
+ case couchbase::core::bucket_capability::subdoc_document_macro_support:
83
+ name = "subdoc_document_macro_support";
84
+ break;
85
+ case couchbase::core::bucket_capability::subdoc_revive_document:
86
+ name = "subdoc_revive_document";
87
+ break;
88
+ case couchbase::core::bucket_capability::dcp_ignore_purged_tombstones:
89
+ name = "dcp_ignore_purged_tombstones";
90
+ break;
91
+ case couchbase::core::bucket_capability::preserve_expiry:
92
+ name = "preserve_expiry";
93
+ break;
94
+ case couchbase::core::bucket_capability::query_system_collection:
95
+ name = "query_system_collection";
96
+ break;
97
+ case couchbase::core::bucket_capability::mobile_system_collection:
98
+ name = "mobile_system_collection";
99
+ break;
79
100
  }
80
101
  return format_to(ctx.out(), "{}", name);
81
102
  }
@@ -111,6 +132,13 @@ struct fmt::formatter<couchbase::core::cluster_capability> {
111
132
  break;
112
133
  case couchbase::core::cluster_capability::n1ql_read_from_replica:
113
134
  name = "n1ql_read_from_replica";
135
+ break;
136
+ case couchbase::core::cluster_capability::search_vector_search:
137
+ name = "search_vector_search";
138
+ break;
139
+ case couchbase::core::cluster_capability::search_scoped_search_index:
140
+ name = "search_scoped_search_index";
141
+ break;
114
142
  }
115
143
  return format_to(ctx.out(), "{}", name);
116
144
  }
@@ -89,8 +89,7 @@ struct configuration {
89
89
  std::optional<std::string> bucket{};
90
90
  std::optional<vbucket_map> vbmap{};
91
91
  std::optional<std::uint64_t> collections_manifest_uid{};
92
- std::set<bucket_capability> bucket_capabilities{};
93
- std::set<cluster_capability> cluster_capabilities{};
92
+ configuration_capabilities capabilities{};
94
93
  node_locator_type node_locator{ node_locator_type::unknown };
95
94
  bool force{ false };
96
95
 
@@ -111,38 +110,6 @@ struct configuration {
111
110
 
112
111
  [[nodiscard]] std::string rev_str() const;
113
112
 
114
- [[nodiscard]] bool supports_enhanced_prepared_statements() const
115
- {
116
- return cluster_capabilities.find(cluster_capability::n1ql_enhanced_prepared_statements) != cluster_capabilities.end();
117
- }
118
-
119
- [[nodiscard]] bool supports_read_from_replica() const
120
- {
121
- return cluster_capabilities.find(cluster_capability::n1ql_read_from_replica) != cluster_capabilities.end();
122
- }
123
-
124
- [[nodiscard]] bool supports_range_scan() const
125
- {
126
- return bucket_capabilities.find(bucket_capability::range_scan) != bucket_capabilities.end();
127
- }
128
-
129
- [[nodiscard]] bool ephemeral() const
130
- {
131
- // Use bucket capabilities to identify if couchapi is missing (then its ephemeral). If its null then
132
- // we are running an old version of couchbase which doesn't have ephemeral buckets at all.
133
- return bucket_capabilities.count(couchbase::core::bucket_capability::couchapi) == 0;
134
- }
135
-
136
- [[nodiscard]] bool supports_subdoc_read_replica() const
137
- {
138
- return bucket_capabilities.find(bucket_capability::replica_read) != bucket_capabilities.end();
139
- }
140
-
141
- [[nodiscard]] bool supports_non_deduped_history() const
142
- {
143
- return bucket_capabilities.find(bucket_capability::non_deduped_history) != bucket_capabilities.end();
144
- }
145
-
146
113
  [[nodiscard]] std::size_t index_for_this_node() const;
147
114
  [[nodiscard]] bool has_node(const std::string& network,
148
115
  service_type type,
@@ -160,7 +160,7 @@ struct fmt::formatter<couchbase::core::topology::configuration> {
160
160
  config.vbmap.has_value() ? fmt::format(", partitions={}", config.vbmap->size()) : "",
161
161
  config.nodes.size(),
162
162
  couchbase::core::utils::join_strings_fmt(config.nodes, ", "),
163
- couchbase::core::utils::join_strings_fmt(config.bucket_capabilities, ", "),
164
- couchbase::core::utils::join_strings_fmt(config.cluster_capabilities, ", "));
163
+ couchbase::core::utils::join_strings_fmt(config.capabilities.bucket, ", "),
164
+ couchbase::core::utils::join_strings_fmt(config.capabilities.cluster, ", "));
165
165
  }
166
166
  };
@@ -213,33 +213,47 @@ struct traits<couchbase::core::topology::configuration> {
213
213
  for (const auto& entry : m->get_array()) {
214
214
  const auto& name = entry.get_string();
215
215
  if (name == "couchapi") {
216
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::couchapi);
216
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::couchapi);
217
217
  } else if (name == "collections") {
218
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::collections);
218
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::collections);
219
219
  } else if (name == "durableWrite") {
220
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::durable_write);
220
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::durable_write);
221
221
  } else if (name == "tombstonedUserXAttrs") {
222
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::tombstoned_user_xattrs);
222
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::tombstoned_user_xattrs);
223
223
  } else if (name == "dcp") {
224
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::dcp);
224
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::dcp);
225
225
  } else if (name == "cbhello") {
226
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::cbhello);
226
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::cbhello);
227
227
  } else if (name == "touch") {
228
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::touch);
228
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::touch);
229
229
  } else if (name == "cccp") {
230
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::cccp);
230
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::cccp);
231
231
  } else if (name == "xdcrCheckpointing") {
232
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::xdcr_checkpointing);
232
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::xdcr_checkpointing);
233
233
  } else if (name == "nodesExt") {
234
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::nodes_ext);
234
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::nodes_ext);
235
235
  } else if (name == "xattr") {
236
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::xattr);
236
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::xattr);
237
237
  } else if (name == "rangeScan") {
238
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::range_scan);
238
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::range_scan);
239
239
  } else if (name == "subdoc.ReplicaRead") {
240
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::replica_read);
240
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::subdoc_replica_read);
241
241
  } else if (name == "nonDedupedHistory") {
242
- result.bucket_capabilities.insert(couchbase::core::bucket_capability::non_deduped_history);
242
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::non_deduped_history);
243
+ } else if (name == "subdoc.ReplaceBodyWithXattr") {
244
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::subdoc_replace_body_with_xattr);
245
+ } else if (name == "subdoc.DocumentMacroSupport") {
246
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::subdoc_document_macro_support);
247
+ } else if (name == "subdoc.ReviveDocument") {
248
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::subdoc_revive_document);
249
+ } else if (name == "dcp.IgnorePurgedTombstones") {
250
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::dcp_ignore_purged_tombstones);
251
+ } else if (name == "preserve_expiry") {
252
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::preserve_expiry);
253
+ } else if (name == "querySystemCollection") {
254
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::query_system_collection);
255
+ } else if (name == "mobileSystemCollection") {
256
+ result.capabilities.bucket.insert(couchbase::core::bucket_capability::mobile_system_collection);
243
257
  }
244
258
  }
245
259
  }
@@ -247,17 +261,26 @@ struct traits<couchbase::core::topology::configuration> {
247
261
  if (const auto nc = m->find("n1ql"); nc != nullptr && nc->is_array()) {
248
262
  for (const auto& entry : nc->get_array()) {
249
263
  if (const auto& name = entry.get_string(); name == "costBasedOptimizer") {
250
- result.cluster_capabilities.insert(couchbase::core::cluster_capability::n1ql_cost_based_optimizer);
264
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::n1ql_cost_based_optimizer);
251
265
  } else if (name == "indexAdvisor") {
252
- result.cluster_capabilities.insert(couchbase::core::cluster_capability::n1ql_index_advisor);
266
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::n1ql_index_advisor);
253
267
  } else if (name == "javaScriptFunctions") {
254
- result.cluster_capabilities.insert(couchbase::core::cluster_capability::n1ql_javascript_functions);
268
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::n1ql_javascript_functions);
255
269
  } else if (name == "inlineFunctions") {
256
- result.cluster_capabilities.insert(couchbase::core::cluster_capability::n1ql_inline_functions);
270
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::n1ql_inline_functions);
257
271
  } else if (name == "enhancedPreparedStatements") {
258
- result.cluster_capabilities.insert(couchbase::core::cluster_capability::n1ql_enhanced_prepared_statements);
272
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::n1ql_enhanced_prepared_statements);
259
273
  } else if (name == "readFromReplica") {
260
- result.cluster_capabilities.insert(couchbase::core::cluster_capability::n1ql_read_from_replica);
274
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::n1ql_read_from_replica);
275
+ }
276
+ }
277
+ }
278
+ if (const auto sc = m->find("search"); sc != nullptr && sc->is_array()) {
279
+ for (const auto& entry : sc->get_array()) {
280
+ if (const auto& name = entry.get_string(); name == "vectorSearch") {
281
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::search_vector_search);
282
+ } else if (name == "scopedSearchIndex") {
283
+ result.capabilities.cluster.insert(couchbase::core::cluster_capability::search_scoped_search_index);
261
284
  }
262
285
  }
263
286
  }
@@ -230,6 +230,11 @@ class transaction_operation_failed : public std::runtime_error
230
230
  return cause_;
231
231
  }
232
232
 
233
+ final_error to_raise() const
234
+ {
235
+ return to_raise_;
236
+ }
237
+
233
238
  void do_throw(const transaction_context& context) const
234
239
  {
235
240
  if (to_raise_ == FAILED_POST_COMMIT) {
@@ -79,7 +79,7 @@ class bucket
79
79
  * Performs application-level ping requests against services in the Couchbase cluster.
80
80
  *
81
81
  * @note This operation performs active I/O against services and endpoints to assess their health. If you do not
82
- * wish to performs I/O, consider using @ref diagnostics() instead.
82
+ * wish to performs I/O, consider using @ref cluster::diagnostics() instead.
83
83
  *
84
84
  * @param options custom options to change the default behavior.
85
85
  * @param handler the handler that implements @ref ping_handler.
@@ -93,7 +93,7 @@ class bucket
93
93
  * Performs application-level ping requests against services in the Couchbase cluster.
94
94
  *
95
95
  * @note This operation performs active I/O against services and endpoints to assess their health. If you do not
96
- * wish to performs I/O, consider using @ref diagnostics() instead.
96
+ * wish to performs I/O, consider using @ref cluster::diagnostics() instead.
97
97
  *
98
98
  * @param options custom options to change the default behavior.
99
99
  * @return future object that carries result of the operation.
@@ -222,7 +222,7 @@ class cluster
222
222
  * @since 1.0.0
223
223
  * @volatile
224
224
  */
225
- [[nodiscard]] auto search(std::string index_name, search_request request, const search_options& = {}) const
225
+ [[nodiscard]] auto search(std::string index_name, search_request request, const search_options& options = {}) const
226
226
  -> std::future<std::pair<search_error_context, search_result>>;
227
227
 
228
228
  /**
@@ -791,6 +791,7 @@ class collection
791
791
  * @param document_id the outer document ID
792
792
  * @param specs an object that specifies the types of lookups to perform
793
793
  * @param options custom options to modify the lookup options
794
+ * @param handler callable that implements @ref lookup_in_any_replica_handler
794
795
  *
795
796
  * @exception errc::key_value::document_not_found the given document id is not found in the collection.
796
797
  * @exception errc::common::ambiguous_timeout
@@ -53,8 +53,7 @@ class collection_query_index_manager
53
53
  {
54
54
  public:
55
55
  /**
56
- * Get all indexes within a collection.
57
- *
56
+ * Get all indexes within the collection.
58
57
  *
59
58
  * @param options optional parameters
60
59
  * @param handler the handler that implements @ref get_all_query_indexes_handler
@@ -64,13 +63,23 @@ class collection_query_index_manager
64
63
  */
65
64
  void get_all_indexes(const get_all_query_indexes_options& options, get_all_query_indexes_handler&& handler) const;
66
65
 
66
+ /**
67
+ * Get all indexes within the collection.
68
+ *
69
+ * @param options optional parameters
70
+ * @return future object that carries result of the operation
71
+ *
72
+ * @since 1.0.0
73
+ * @committed
74
+ */
67
75
  [[nodiscard]] auto get_all_indexes(const get_all_query_indexes_options& options) const
68
76
  -> std::future<std::pair<manager_error_context, std::vector<couchbase::management::query_index>>>;
77
+
69
78
  /**
70
79
  * Create an index on the collection.
71
80
  *
72
81
  * @param index_name name of the index
73
- * @param fields the fields to create the index over
82
+ * @param keys the keys to create the index over
74
83
  * @param options optional parameters
75
84
  * @param handler the handler that implements @ref create_query_index_handler
76
85
  *
@@ -78,16 +87,26 @@ class collection_query_index_manager
78
87
  * @committed
79
88
  */
80
89
  void create_index(std::string index_name,
81
- std::vector<std::string> fields,
90
+ std::vector<std::string> keys,
82
91
  const create_query_index_options& options,
83
92
  create_query_index_handler&& handler) const;
84
93
 
85
- [[nodiscard]] auto create_index(std::string index_name,
86
- std::vector<std::string> fields,
87
- const create_query_index_options& options) const -> std::future<manager_error_context>;
94
+ /**
95
+ * Create an index on the collection.
96
+ *
97
+ * @param index_name name of the index
98
+ * @param keys the keys to create the index over
99
+ * @param options optional parameters
100
+ * @return future object that carries result of the operation
101
+ *
102
+ * @since 1.0.0
103
+ * @committed
104
+ */
105
+ [[nodiscard]] auto create_index(std::string index_name, std::vector<std::string> keys, const create_query_index_options& options) const
106
+ -> std::future<manager_error_context>;
88
107
 
89
108
  /**
90
- * Create a primary index on a collection.
109
+ * Create a primary index on the collection.
91
110
  *
92
111
  * @param options optional parameters
93
112
  * @param handler the handler that implements @ref create_query_index_handler
@@ -97,10 +116,19 @@ class collection_query_index_manager
97
116
  */
98
117
  void create_primary_index(const create_primary_query_index_options& options, create_query_index_handler&& handler) const;
99
118
 
119
+ /**
120
+ * Create a primary index on the collection.
121
+ *
122
+ * @param options optional parameters
123
+ * @return future object that carries result of the operation
124
+ *
125
+ * @since 1.0.0
126
+ * @committed
127
+ */
100
128
  [[nodiscard]] auto create_primary_index(const create_primary_query_index_options& options) const -> std::future<manager_error_context>;
101
129
 
102
130
  /**
103
- * Drop primary index on a collection.
131
+ * Drop primary index on the collection.
104
132
  *
105
133
  * @param options optional parameters
106
134
  * @param handler the handler that implements @ref drop_query_index_handler
@@ -110,10 +138,19 @@ class collection_query_index_manager
110
138
  */
111
139
  void drop_primary_index(const drop_primary_query_index_options& options, drop_query_index_handler&& handler) const;
112
140
 
141
+ /**
142
+ * Drop primary index on the collection.
143
+ *
144
+ * @param options optional parameters
145
+ * @return future object that carries result of the operation
146
+ *
147
+ * @since 1.0.0
148
+ * @committed
149
+ */
113
150
  [[nodiscard]] auto drop_primary_index(const drop_primary_query_index_options& options) const -> std::future<manager_error_context>;
114
151
 
115
152
  /**
116
- * Drop index in collection.
153
+ * Drop specified query index in the collection.
117
154
  *
118
155
  * @param index_name name of the index to drop
119
156
  * @param options optional parameters
@@ -124,14 +161,25 @@ class collection_query_index_manager
124
161
  */
125
162
  void drop_index(std::string index_name, const drop_query_index_options& options, drop_query_index_handler&& handler) const;
126
163
 
164
+ /**
165
+ * Drop specified query index in the collection.
166
+ *
167
+ * @param index_name name of the index to drop
168
+ * @param options optional parameters
169
+ * @return future object that carries result of the operation
170
+ *
171
+ * @since 1.0.0
172
+ * @committed
173
+ */
127
174
  [[nodiscard]] auto drop_index(std::string index_name, const drop_query_index_options& options) const
128
175
  -> std::future<manager_error_context>;
176
+
129
177
  /**
130
178
  * Builds all currently deferred indexes in this collection.
131
179
  *
132
180
  * By default, this method will build the indexes on the collection.
133
181
  *
134
- * @param options the custom options
182
+ * @param options optional parameters
135
183
  * @param handler the handler that implements @ref build_deferred_query_indexes_handler
136
184
  *
137
185
  * @since 1.0.0
@@ -139,6 +187,17 @@ class collection_query_index_manager
139
187
  */
140
188
  void build_deferred_indexes(const build_query_index_options& options, build_deferred_query_indexes_handler&& handler) const;
141
189
 
190
+ /**
191
+ * Builds all currently deferred indexes in this collection.
192
+ *
193
+ * By default, this method will build the indexes on the collection.
194
+ *
195
+ * @param options optional parameters
196
+ * @return future object that carries result of the operation
197
+ *
198
+ * @since 1.0.0
199
+ * @committed
200
+ */
142
201
  [[nodiscard]] auto build_deferred_indexes(const build_query_index_options& options) const -> std::future<manager_error_context>;
143
202
 
144
203
  /**
@@ -155,6 +214,16 @@ class collection_query_index_manager
155
214
  const watch_query_indexes_options& options,
156
215
  watch_query_indexes_handler&& handler) const;
157
216
 
217
+ /**
218
+ * Polls the state of a set of indexes, until they all are online.
219
+ *
220
+ * @param index_names names of the indexes to watch
221
+ * @param options optional parameters
222
+ * @return future object that carries result of the operation
223
+ *
224
+ * @since 1.0.0
225
+ * @committed
226
+ */
158
227
  [[nodiscard]] auto watch_indexes(std::vector<std::string> index_names, const watch_query_indexes_options& options) const
159
228
  -> std::future<manager_error_context>;
160
229
 
@@ -48,6 +48,7 @@ class error_context
48
48
  /**
49
49
  * Creates and initializes error context with given parameters.
50
50
  *
51
+ * @param operation_id
51
52
  * @param ec
52
53
  * @param last_dispatched_to
53
54
  * @param last_dispatched_from
@@ -257,7 +257,9 @@ struct fmt::formatter<couchbase::key_value_status_code> {
257
257
  case key_value_status_code::range_scan_vb_uuid_not_equal:
258
258
  name = "range_scan_vb_uuid_not_equal (0xa8)";
259
259
  break;
260
-
260
+ case key_value_status_code::config_only:
261
+ name = "config_only (0x0d)";
262
+ break;
261
263
  case key_value_status_code::unknown:
262
264
  name = "unknown (0xffff)";
263
265
  break;
@@ -50,7 +50,7 @@ class get_links_analytics_options : public common_options<get_links_analytics_op
50
50
  /**
51
51
  * The name of the link to fetch.
52
52
  *
53
- * @param link_name
53
+ * @param name link name
54
54
  * @return reference to this object, for use in chaining
55
55
  *
56
56
  * @since 1.0.0
@@ -65,7 +65,7 @@ class get_links_analytics_options : public common_options<get_links_analytics_op
65
65
  /**
66
66
  * The type of links to restrict returned links to.
67
67
  *
68
- * @param link_type
68
+ * @param link_type link type
69
69
  * @return reference to this object, for use in chaining
70
70
  *
71
71
  * @since 1.0.0
@@ -35,6 +35,7 @@ enum class key_value_status_code : std::uint16_t {
35
35
  opaque_no_match = 0x0b,
36
36
  locked = 0x09,
37
37
  not_locked = 0x0e,
38
+ config_only = 0x0d,
38
39
  auth_stale = 0x1f,
39
40
  auth_error = 0x20,
40
41
  auth_continue = 0x21,