我需要同时在arangodb
和redis
中放入一些数据,但是我需要一些有关如何做的帮助。
类似这样的东西:
global $connection;
$time=date('Y-m-d H:i:s');
$document = array(
"replyTo" => $replyTo,
"user_key" => $uid,
'view_option' =>$view,
'topics'=> $topics,
'type'=>$type,
'time'=>$time,
'content'=>$content,
'comments'=>0,
'upvotes'=>0,
'downvotes'=>0,
'age_res'=>$agerestriction
);
$query="INSERT @doc IN `posts` RETURN NEW";
$statement = new Statement(
$connection,
array(
"query" => $query,
"bindVars" => array("doc" => $document)
)
);
//waiting for redis transaction to be done
$statement->execute();