org.apache.pekko.stream.connectors.couchbase.scaladsl
CouchbaseSession
Companion object CouchbaseSession
trait CouchbaseSession extends AnyRef
Scala API: A Couchbase session allowing querying and interacting with a specific couchbase bucket.
Not for user extension.
- Annotations
- @DoNotInherit()
- Source
- CouchbaseSession.scala
- Alphabetic
- By Inheritance
- CouchbaseSession
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def asJava: javadsl.CouchbaseSession
- abstract def close(): Future[Done]
Close the session and release all resources it holds.
Close the session and release all resources it holds. Subsequent calls to other methods will likely fail.
- abstract def counter(id: String, delta: Long, initial: Long, writeSettings: CouchbaseWriteSettings): Future[Long]
Create or increment a counter
Create or increment a counter
- id
What counter document id
- delta
Value to increase the counter with if it does exist
- initial
Value to start from if the counter does not exist
- returns
The value of the counter after applying the delta
- abstract def counter(id: String, delta: Long, initial: Long): Future[Long]
Create or increment a counter
Create or increment a counter
- id
What counter document id
- delta
Value to increase the counter with if it does exist
- initial
Value to start from if the counter does not exist
- returns
The value of the counter after applying the delta
- abstract def createIndex(indexName: String, ignoreIfExist: Boolean, fields: AnyRef*): Future[Boolean]
Create a secondary index for the current bucket.
Create a secondary index for the current bucket.
- indexName
the name of the index.
- ignoreIfExist
if a secondary index already exists with that name, an exception will be thrown unless this is set to true.
- fields
the JSON fields to index - each can be either
String
or [com.couchbase.client.java.query.dsl.Expression]- returns
a scala.concurrent.Future of
true
if the index was/will be effectively created,false
if the index existed andignoreIfExist
istrue
. Completion of the future does not guarantee the index is online and ready to be used.
- abstract def get[T <: Document[_]](id: String, timeout: FiniteDuration, documentClass: Class[T]): Future[Option[T]]
- returns
A document of the given type if found or none if there is no document for the id
- abstract def get(id: String, timeout: FiniteDuration): Future[Option[JsonDocument]]
- timeout
fail the returned future with a TimeoutException if it takes longer than this
- returns
A document if found or none if there is no document for the id
- abstract def get[T <: Document[_]](id: String, documentClass: Class[T]): Future[Option[T]]
- returns
A document of the given type if found or none if there is no document for the id
- abstract def get(id: String): Future[Option[JsonDocument]]
- returns
A document if found or none if there is no document for the id
- abstract def insert(document: JsonDocument, writeSettings: CouchbaseWriteSettings): Future[JsonDocument]
Insert a JSON document using the given write settings.
Insert a JSON document using the given write settings.
For inserting other types of documents see
insertDoc
. - abstract def insert(document: JsonDocument): Future[JsonDocument]
Insert a JSON document using the default write settings.
Insert a JSON document using the default write settings.
For inserting other types of documents see
insertDoc
.- returns
A future that completes with the written document when the write completes
- abstract def insertDoc[T <: Document[_]](document: T, writeSettings: CouchbaseWriteSettings): Future[T]
Insert any type of document using the given write settings.
Insert any type of document using the given write settings. Separate from
insert
to make the most common case smoother with the type inference- returns
A future that completes with the written document when the write completes
- abstract def insertDoc[T <: Document[_]](document: T): Future[T]
Insert any type of document using the default write settings.
Insert any type of document using the default write settings. Separate from
insert
to make the most common case smoother with the type inference- returns
A future that completes with the written document when the write completes
- abstract def listIndexes(): Source[IndexInfo, NotUsed]
List the existing secondary indexes for the bucket
- abstract def remove(id: String, writeSettings: CouchbaseWriteSettings): Future[Done]
Remove a document by id using the default write settings.
Remove a document by id using the default write settings.
- returns
Future that completes when the document has been removed, if there is no such document the future is failed with a
DocumentDoesNotExistException
- abstract def remove(id: String): Future[Done]
Remove a document by id using the default write settings.
Remove a document by id using the default write settings.
- returns
Future that completes when the document has been removed, if there is no such document the future is failed with a
DocumentDoesNotExistException
- abstract def replace(document: JsonDocument, writeSettings: CouchbaseWriteSettings): Future[JsonDocument]
Replace using the given write settings
Replace using the given write settings
For replacing other types of documents see
replaceDoc
.- returns
a future that completes when the replace is done
- abstract def replace(document: JsonDocument): Future[JsonDocument]
Replace using the default write settings.
Replace using the default write settings.
For replacing other types of documents see
replaceDoc
.- returns
a future that completes when the replace is done
- abstract def replaceDoc[T <: Document[_]](document: T, writeSettings: CouchbaseWriteSettings): Future[T]
Replace using the given write settings
Replace using the given write settings
Separate from
replace
to make the most common case smoother with the type inference- returns
a future that completes when the replace is done
- abstract def replaceDoc[T <: Document[_]](document: T): Future[T]
Replace using the default write settings.
Replace using the default write settings.
Separate from
replace
to make the most common case smoother with the type inference- returns
a future that completes when the replace is done
- abstract def singleResponseQuery(query: N1qlQuery): Future[Option[JsonObject]]
- abstract def singleResponseQuery(query: Statement): Future[Option[JsonObject]]
- abstract def streamedQuery(query: Statement): Source[JsonObject, NotUsed]
- abstract def streamedQuery(query: N1qlQuery): Source[JsonObject, NotUsed]
- abstract def underlying: AsyncBucket
- abstract def upsert(document: JsonDocument, writeSettings: CouchbaseWriteSettings): Future[JsonDocument]
Upsert using the given write settings
Upsert using the given write settings
For upserting other types of documents see
upsertDoc
.- returns
a future that completes when the upsert is done
- abstract def upsert(document: JsonDocument): Future[JsonDocument]
Upsert using the default write settings.
Upsert using the default write settings.
For upserting other types of documents see
upsertDoc
.- returns
a future that completes when the upsert is done
- abstract def upsertDoc[T <: Document[_]](document: T, writeSettings: CouchbaseWriteSettings): Future[T]
Upsert using the given write settings
Upsert using the given write settings
Separate from
upsert
to make the most common case smoother with the type inference- returns
a future that completes when the upsert is done
- abstract def upsertDoc[T <: Document[_]](document: T): Future[T]
Upsert using the default write settings.
Upsert using the default write settings.
Separate from
upsert
to make the most common case smoother with the type inference- returns
a future that completes when the upsert is done
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()