How to execute arangodb transaction in php after redis transaction is comfirmed?

68 Views Asked by At

I need to put some data in arangodb and redis at the same time but I need some help on how to do it.

Something like this:

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

There are 0 best solutions below