The following example demonstrates connecting, setting, then getting a record:
<?php $cb = new Couchbase(”host:8091", "bucket", "pass", "bucket"); $cb->set("hello", "Hello World"); var_dump($cb->get("hello")); ?>
The same pattern would be used in any given SDK: connect, then perform a set with key/value, and within the same connection, get and output the new value.
require 'rubygems' require 'couchbase' client = Couchbase.connect "http://<host>:8091/pools/default" client.set "new", "Test content", :ttl => 20 rec = client.get "new" if(rec) puts rec else puts "no record" end