Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
Loading...
Searching...
No Matches
scope Class Reference

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 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.
 
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
 

Detailed Description

The scope identifies a group of collections and allows high application density as a result.

Since
1.0.0

Member Function Documentation

◆ analytics_query() [1/2]

void analytics_query ( std::string statement,
const analytics_options & options,
analytics_handler && handler ) const

Performs a query against the analytics services.

Parameters
statementthe query statement.
optionsoptions to customize the query request.
handlerthe handler that implements query_handler
Exceptions
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
See also
https://docs.couchbase.com/server/current/analytics/introduction.html
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ analytics_query() [2/2]

auto analytics_query ( std::string statement,
const analytics_options & options = {} ) const -> std::future< std::pair< error, analytics_result > >
nodiscard

Performs a query against the analytics services.

Parameters
statementthe query statement.
optionsoptions to customize the query request.
Returns
future object that carries result of the operation
See also
https://docs.couchbase.com/server/current/analytics/introduction.html
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ bucket_name()

auto bucket_name ( ) const -> const std::string &
nodiscard

Returns name of the bucket where the scope is defined.

Returns
name of the bucket
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ collection()

auto collection ( std::string_view collection_name) const -> collection
nodiscard

Opens a collection for this scope with an explicit name.

Parameters
collection_namethe collection name.
Returns
the requested collection if successful.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ name()

auto name ( ) const -> const std::string &
nodiscard

Returns name of the scope.

Returns
name of the scope
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ query() [1/2]

void query ( std::string statement,
const query_options & options,
query_handler && handler ) const

Performs a query against the query (N1QL) services.

Parameters
statementthe N1QL query statement.
optionsoptions to customize the query request.
handlerthe handler that implements query_handler
Exceptions
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ query() [2/2]

auto query ( std::string statement,
const query_options & options = {} ) const -> std::future< std::pair< error, query_result > >
nodiscard

Performs a query against the query (N1QL) services.

Parameters
statementthe N1QL query statement.
optionsoptions to customize the query request.
Returns
future object that carries result of the operation
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ search() [1/2]

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.

Parameters
index_namename of the search index
requestrequest object, see search_request for more details.
optionsoptions to customize the query request.
handlerthe handler that implements search_handler
Exceptions
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
See also
https://docs.couchbase.com/server/current/fts/fts-introduction.html
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ search() [2/2]

auto search ( std::string index_name,
search_request request,
const search_options & options = {} ) const -> std::future< std::pair< error, search_result > >
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.

Parameters
index_namename of the search index
requestrequest object, see search_request for more details.
optionsoptions to customize the query request.
Returns
future object that carries result of the operation
Exceptions
errc::common::ambiguous_timeout
errc::common::unambiguous_timeout
See also
https://docs.couchbase.com/server/current/fts/fts-introduction.html
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ search_indexes()

auto search_indexes ( ) const -> scope_search_index_manager
nodiscard

Provides access to search index management services at the scope level.

Returns
a manager instance
Since
1.0.0
Volatile
Should not be used in production

Friends And Related Symbol Documentation

◆ bucket

friend class bucket
friend

Member Data Documentation

◆ default_name

auto default_name { "_default" }
staticconstexpr

Constant for the name of the default scope in the bucket.

Since
1.0.0
Committed
Generally available API and should be preferred in production
Examples
distributed_mutex.cxx, and minimal.cxx.

The documentation for this class was generated from the following file: