Skip to content

Instantly share code, notes, and snippets.

@h3lls
Created January 20, 2011 05:05
Show Gist options
  • Save h3lls/787423 to your computer and use it in GitHub Desktop.
Save h3lls/787423 to your computer and use it in GitHub Desktop.
CouchDB is great, let's see if Riak is too..
$doc = new stdClass();
$doc->type = "battle";
$doc->charactername = $record["charactername"];
$doc->monster = $record["monster"];
$doc->datetime = $record["datetime"];
$doc->monstermiss = $record["monstermiss"];
$doc->othermonstermiss = $record["othermonstermiss"];
$doc->damage = $record["damage"];
$doc->miss = $record["miss"];
$doc->hitdamage = $record["hitdamage"];
$doc->otherdamage = $record["otherdamage"];
$doc->othermiss = $record["othermiss"];
$doc->otherhitdamage = $record["otherhitdamage"];
$doc->skillpoints = $record["skillpoints"];
$doc->exp = $record["exp"];
$doc->class = $record["class"];
// Is this how Php Riak users usually do unique id's?
$obj = $bucket->newObject(uniqid('', true), $doc);
$obj->store();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment