Couchbase Scala SDK 1.8 | Couchbase Docs (original) (raw)

The Couchbase Scala SDK allows Scala applications to access a Couchbase cluster — Capella or self-managed.

What’s the point of a fast and scalable database if it’s not easy to develop for? Couchbase gives you the Scala APIs to work with Capella, our managed solution, or self-managed options in your private Cloud or datacenter.

val json = JsonObject("foo" -> "bar", "baz" -> "qux")

collection.upsert("document-key", json) match {
  case Success(result)    => println("Document upsert successful")
  case Failure(exception) => println("Error: " + exception)
}
val statement = """select * from `travel-sample` limit 10;"""
val result: Try[QueryResult] = cluster.query(statement)
val request = SearchRequest.vectorSearch(VectorSearch(VectorQuery("vector_field", vectorQuery)))

val result: Try[SearchResult] = scope.search("vector-index", request)

Couchbase is a large platform — covering many services — and Couchbase SDKs are not thin wrappers generated around a REST API, but well thought out interfaces to the platform that make it easier to design and maintain your client code, and work with Couchbase in more natural ways for your platform. Install the SDK, and explore in the way that works best for you.

Installing the SDK via Scala Build Tool

libraryDependencies += "com.couchbase.client" %% "scala-client" % "1.8.2"

The links below will take you where you want to go — as will the navigation on the left-hand side of this page. But if you don’t know exactly where you need to go, try one of the following:

Using Your Database

How-to guides to help you start your development journey with Couchbase and the Scala SDK.

Resources

Useful resources to help support your development experience with Couchbase and the Scala SDK.

| | Columnar SDKs SDKs for Capella Columnar — Couchbase’s analytical database (RT-OLAP) for real time apps and operational intelligence — are available for the Go, Java, Node.js, and Python platforms. See the Capella Columnar SDK pages for more information. | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |