Sha256: 319f70067aff5a055b1f99b8e56ddaddfe89b57866fa33d07ac7775aa37db1ee
Contents?: true
Size: 643 Bytes
Versions: 18
Compression:
Stored size: 643 Bytes
Contents
require 'couchbase' include Couchbase options = Cluster::ClusterOptions.new options.authenticate("Administrator", "password") cluster = Cluster.connect("couchbase://localhost", options) cluster.bucket("travel-sample") # this is necessary for 6.0.x options = Cluster::QueryOptions.new options.named_parameters({type: "hotel"}) options.metrics = true res = cluster.query("SELECT * FROM `travel-sample` WHERE type = $type LIMIT 10", options) res.rows.each do |row| puts "#{row["travel-sample"]["country"]}. #{row["travel-sample"]["name"]}" end puts "Status: #{res.meta_data.status}. Execution time: #{res.meta_data.metrics.execution_time}"
Version data entries
18 entries across 18 versions & 1 rubygems