|
Couchbase C++ SDK 1.4.0 (rev. 59aa900)
|
The scope identifies a group of collections and allows high application density as a result. More...
#include <couchbase/scope.hxx>
Public Member Functions | |
| auto | bucket_name () const -> const std::string & |
| Returns name of the bucket where the scope is defined. | |
| auto | name () const -> const std::string & |
| Returns name of the scope. | |
| auto | collection (std::string_view collection_name) const -> collection |
| Opens a collection for this scope with an explicit name. | |
| void | query (std::string statement, const query_options &options, query_handler &&handler) const |
| Performs a query against the query (N1QL) services. | |
| auto | query (std::string statement, const query_options &options={}) const -> std::future< std::pair< error, query_result > > |
| Performs a query against the query (N1QL) services. | |
| void | query_stream (std::string statement, const query_options &options, query_stream_handler &&handler) const |
| Performs a streaming query against the query (N1QL) services. | |
| auto | query_stream (std::string statement, const query_options &options={}) const -> std::future< std::pair< error, query_stream_result > > |
| Performs a streaming query against the query (N1QL) services. | |
| void | search (std::string index_name, search_request request, const search_options &options, search_handler &&handler) const |
| Performs a request against the full text search services. | |
| auto | search (std::string index_name, search_request request, const search_options &options={}) const -> std::future< std::pair< error, search_result > > |
| Performs a request against the full text search services. | |
| void | analytics_query (std::string statement, const analytics_options &options, analytics_handler &&handler) const |
| Performs a query against the analytics services. | |
| auto | analytics_query (std::string statement, const analytics_options &options={}) const -> std::future< std::pair< error, analytics_result > > |
| Performs a query against the analytics services. | |
| void | analytics_query_stream (std::string statement, const analytics_options &options, analytics_stream_handler &&handler) const |
| Performs a streaming query against the analytics services. | |
| auto | analytics_query_stream (std::string statement, const analytics_options &options={}) const -> std::future< std::pair< error, analytics_stream_result > > |
| Performs a streaming query against the analytics services. | |
| auto | search_indexes () const -> scope_search_index_manager |
| Provides access to search index management services at the scope level. | |
Static Public Attributes | |
| static constexpr auto | default_name { "_default" } |
| Constant for the name of the default scope in the bucket. | |
Friends | |
| class | bucket |
The scope identifies a group of collections and allows high application density as a result.
| void analytics_query | ( | std::string | statement, |
| const analytics_options & | options, | ||
| analytics_handler && | handler ) const |
Performs a query against the analytics services.
| statement | the query statement. |
| options | options to customize the query request. |
| handler | the handler that implements query_handler |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs a query against the analytics services.
| statement | the query statement. |
| options | options to customize the query request. |
| void analytics_query_stream | ( | std::string | statement, |
| const analytics_options & | options, | ||
| analytics_stream_handler && | handler ) const |
Performs a streaming query against the analytics services.
The handler resolves as soon as the response preamble has been parsed; rows are then pulled lazily from the analytics_stream_result, so the full result is never buffered in memory.
| statement | the analytics query statement. |
| options | options to customize the query request. |
| handler | the handler that implements analytics_stream_handler |
|
nodiscard |
Performs a streaming query against the analytics services.
The example is written against analytics_query_stream(), but the scope-level overload behaves identically apart from resolving the statement against this scope:
| statement | the analytics query statement. |
| options | options to customize the query request. |
|
nodiscard |
Returns name of the bucket where the scope is defined.
|
nodiscard |
Opens a collection for this scope with an explicit name.
| collection_name | the collection name. |
|
nodiscard |
Returns name of the scope.
| void query | ( | std::string | statement, |
| const query_options & | options, | ||
| query_handler && | handler ) const |
Performs a query against the query (N1QL) services.
| statement | the N1QL query statement. |
| options | options to customize the query request. |
| handler | the handler that implements query_handler |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs a query against the query (N1QL) services.
| statement | the N1QL query statement. |
| options | options to customize the query request. |
| void query_stream | ( | std::string | statement, |
| const query_options & | options, | ||
| query_stream_handler && | handler ) const |
Performs a streaming query against the query (N1QL) services.
The handler resolves as soon as the response preamble has been parsed; rows are then pulled lazily from the query_stream_result, so the full result is never buffered in memory.
The handler runs on the library's I/O thread, so the stream must be drained with the callback next() overload rather than the blocking ones. The example is written against query_stream(), but the scope-level overload behaves identically:
| statement | the N1QL query statement. |
| options | options to customize the query request. |
| handler | the handler that implements query_stream_handler |
|
nodiscard |
Performs a streaming query against the query (N1QL) services.
Unqualified keyspaces in the statement resolve against this scope, so it names the collection rather than the bucket. The result can be consumed with a range-based for loop, and abandoned early without transferring the rows that were never read:
| statement | the N1QL query statement. |
| options | options to customize the query request. |
| void search | ( | std::string | index_name, |
| search_request | request, | ||
| const search_options & | options, | ||
| search_handler && | handler ) const |
Performs a request against the full text search services.
This can be used to perform a traditional FTS query, and/or a vector search.
| index_name | name of the search index |
| request | request object, see search_request for more details. |
| options | options to customize the query request. |
| handler | the handler that implements search_handler |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Performs a request against the full text search services.
This can be used to perform a traditional FTS query, and/or a vector search.
| index_name | name of the search index |
| request | request object, see search_request for more details. |
| options | options to customize the query request. |
| errc::common::ambiguous_timeout | |
| errc::common::unambiguous_timeout |
|
nodiscard |
Provides access to search index management services at the scope level.
|
friend |
|
staticconstexpr |
Constant for the name of the default scope in the bucket.