确认Redis事务后如何在php中执行arangodb事务?

时间:2018-08-16 03:13:50

标签: php redis arangodb arangodb-php

我需要同时在arangodbredis中放入一些数据,但是我需要一些有关如何做的帮助。

类似这样的东西:

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();

0 个答案:

没有答案