kyototycoon get_bulk 複数レコードを処理する。
[http://fallabs.com/kyototycoon/spex.html]
/rpc/get_bulk
Retrieve records at once.
input: DB: (optional): the database identifier.
input: atomic: (optional): to perform all operations atomically. If it is omitted, non-atomic operations are performed.
input: (optional): arbitrary keys which trail “_”.
output: num: the number of retrieved reocrds.
output: (optional): arbitrary keys which trail the character “_”.
status code: 200.
Retrieve records at once.
input: DB: (optional): the database identifier.
input: atomic: (optional): to perform all operations atomically. If it is omitted, non-atomic operations are performed.
input: (optional): arbitrary keys which trail “_”.
output: num: the number of retrieved reocrds.
output: (optional): arbitrary keys which trail the character “_”.
status code: 200.
配列を渡すようにget_bulk。
public function get_bulk($keys,$db=null){
$api = $this->baseUrl;
if( is_array($keys) ){
$api .= ‘get_bulk';
foreach($keys as $k){
$params['_'.$k] = ”;
}
}else{
return false;
}
if($db) $params['DB']=$db;
return $this->post($api, $params);
}
$api = $this->baseUrl;
if( is_array($keys) ){
$api .= ‘get_bulk';
foreach($keys as $k){
$params['_'.$k] = ”;
}
}else{
return false;
}
if($db) $params['DB']=$db;
return $this->post($api, $params);
}
set_bulk, remove_bulkも同じ感じで。