0

我需要同时输入一些数据,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();
4

0 回答 0