Skip to content

Instantly share code, notes, and snippets.

@sqs
Created November 27, 2012 08:36
Show Gist options
  • Save sqs/4153149 to your computer and use it in GitHub Desktop.
Save sqs/4153149 to your computer and use it in GitHub Desktop.
import collection.JavaConversions._
import java.net.URI
import java.net.ConnectException
import java.util.concurrent.TimeUnit
import com.couchbase.client.protocol.views.ViewRow
import com.couchbase.client.CouchbaseClient
import com.couchbase.client.protocol.views.Query
import java.util.concurrent.TimeUnit
import com.couchbase.client.protocol.views.ComplexKey
import com.couchbase.client.protocol.views.Stale
object Main extends App {
val uris = List(URI.create("http://case.local.compose.cc:8091/pools"))
val client = new CouchbaseClient(uris, "comments", "baileydog")
val view = client.asyncGetView("all", "author").get(6000, TimeUnit.MILLISECONDS)
val query = new Query()
query.setLimit(5)
query.setStale(Stale.FALSE)
val res = client.query(view, query).toList
println("Res = " + res)
client.shutdown()
System.exit(0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment