Class ReactiveScope

java.lang.Object
com.couchbase.client.java.ReactiveScope

public class ReactiveScope extends Object
The scope identifies a group of collections and allows high application density as a result.

If no scope is explicitly provided, the default scope is used.

Since:
3.0.0
  • Method Details

    • name

      public String name()
      The name of the scope.
      Returns:
      the name of the scope.
    • bucketName

      public String bucketName()
      The name of the bucket this scope is attached to.
    • async

      public AsyncScope async()
      Returns the underlying async scope.
    • core

      @Volatile public com.couchbase.client.core.Core core()
      Provides access to the underlying Core.

      This is advanced API, use with care!

    • environment

      public ClusterEnvironment environment()
      Provides access to the configured ClusterEnvironment for this scope.
    • collection

      public ReactiveCollection collection(String collectionName)
      Opens a collection for this scope with an explicit name.
      Parameters:
      collectionName - the collection name.
      Returns:
      the requested collection if successful.
    • query

      public Mono<ReactiveQueryResult> query(String statement)
      Performs a N1QL query with default QueryOptions in a Scope
      Parameters:
      statement - the N1QL query statement as a raw string.
      Returns:
      the ReactiveQueryResult once the response arrives successfully.
    • query

      public Mono<ReactiveQueryResult> query(String statement, QueryOptions options)
      Performs a N1QL query with custom QueryOptions in a Scope
      Parameters:
      statement - the N1QL query statement as a raw string.
      options - the custom options for this query.
      Returns:
      the ReactiveQueryResult once the response arrives successfully.
    • analyticsQuery

      public Mono<ReactiveAnalyticsResult> analyticsQuery(String statement)
      Performs an Analytics query with default AnalyticsOptions on a scope
      Parameters:
      statement - the Analytics query statement as a raw string.
      Returns:
      the ReactiveAnalyticsResult once the response arrives successfully.
    • analyticsQuery

      public Mono<ReactiveAnalyticsResult> analyticsQuery(String statement, AnalyticsOptions options)
      Performs an Analytics query with custom AnalyticsOptions on a scope
      Parameters:
      statement - the Analytics query statement as a raw string.
      options - the custom options for this analytics query.
      Returns:
      the ReactiveAnalyticsResult once the response arrives successfully.
    • search

      @SinceCouchbase("7.6") public Mono<ReactiveSearchResult> search(String indexName, SearchRequest searchRequest)
      Performs a request against the Full Text Search (FTS) service, with default SearchOptions.

      This can be used to perform a traditional FTS query, and/or a vector search.

      This method is for scoped FTS indexes. To work with global indexes, use ReactiveCluster instead.

      Parameters:
      searchRequest - the request, in the form of a SearchRequest
      Returns:
      the SearchResult once the response arrives successfully, inside a Mono.
      Throws:
      com.couchbase.client.core.error.TimeoutException - if the operation times out before getting a result.
      com.couchbase.client.core.error.CouchbaseException - for all other error reasons (acts as a base type and catch-all).
    • search

      @SinceCouchbase("7.6") public Mono<ReactiveSearchResult> search(String indexName, SearchRequest searchRequest, SearchOptions options)
      Performs a request against the Full Text Search (FTS) service, with custom SearchOptions.

      This can be used to perform a traditional FTS query, and/or a vector search.

      This method is for scoped FTS indexes. To work with global indexes, use ReactiveCluster instead.

      Parameters:
      searchRequest - the request, in the form of a SearchRequest
      Returns:
      the SearchResult once the response arrives successfully, inside a Mono.
      Throws:
      com.couchbase.client.core.error.TimeoutException - if the operation times out before getting a result.
      com.couchbase.client.core.error.CouchbaseException - for all other error reasons (acts as a base type and catch-all).
    • searchQuery

      public Mono<ReactiveSearchResult> searchQuery(String indexName, SearchQuery query)
      Performs a Full Text Search (FTS) query with default SearchOptions.

      This method is for scoped FTS indexes. To work with global indexes, use ReactiveCluster instead.

      New users should consider the newer search(String, SearchRequest) interface instead, which can do both the traditional FTS SearchQuery that this method performs, and/or can also be used to perform a VectorSearch.

      Parameters:
      query - the query, in the form of a SearchQuery
      Returns:
      the ReactiveSearchResult once the response arrives successfully, inside a Mono
    • searchQuery

      public Mono<ReactiveSearchResult> searchQuery(String indexName, SearchQuery query, SearchOptions options)
      Performs a Full Text Search (FTS) query with custom SearchOptions.

      This method is for scoped FTS indexes. To work with global indexes, use ReactiveCluster instead.

      New users should consider the newer search(String, SearchRequest) interface instead, which can do both the traditional FTS SearchQuery that this method performs, and/or can also be used to perform a VectorSearch.

      Parameters:
      query - the query, in the form of a SearchQuery
      options - the custom options for this query.
      Returns:
      the ReactiveSearchResult once the response arrives successfully, inside a Mono
    • eventingFunctions

      @Volatile @SinceCouchbase("7.1") public ReactiveScopeEventingFunctionManager eventingFunctions()
      Provides access to the eventing function management services for functions in this scope.