'tcp://10.16.17.154:8529', ConnectionOptions::OPTION_ENDPOINT => 'tcp://' . $server . ':8529', // authorization type to use (currently supported: 'Basic') ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', // user for basic authorization ConnectionOptions::OPTION_AUTH_USER => $dbuser, // password for basic authorization ConnectionOptions::OPTION_AUTH_PASSWD => $passwd, // connection persistence on server. can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections) ConnectionOptions::OPTION_CONNECTION => 'Close', // connect timeout in seconds ConnectionOptions::OPTION_TIMEOUT => 3, // whether or not to reconnect when a keep-alive connection has timed out on server ConnectionOptions::OPTION_RECONNECT => true, // optionally create new collections when inserting documents ConnectionOptions::OPTION_CREATE => true, // optionally create new collections when inserting documents ConnectionOptions::OPTION_UPDATE_POLICY => UpdatePolicy::LAST, ConnectionOptions::OPTION_DATABASE => $database, ); // open connection $connection = new Connection($connectionOptions); $collectionHandler = new CollectionHandler($connection); $documentHandler = new DocumentHandler($connection); if (isset($_GET['pwd'])){ if ($_GET['pwd'] == 123){ $statement = new Statement($connection, [ 'query' => 'for user in users let name = ( for v, e, p in 1..1 outbound user answered filter v._key==\'29551\' return e.answer ) let answers = ( for v, e, p in 1..1 outbound user answered filter v.type==\'personal\' or v.type==\'aux\' return {qkey: v._key, question: v.question, answer: e.answer} ) return {user: user._key, name: name[0], answers: answers}', 'count' => true, 'batchSize' => 1000, 'bindVars' => null, 'sanitize' => true, ] ); $cursor = $statement->execute(); $users = array(); foreach ($cursor->getAll() as $doc) { $users[] = json_decode(json_encode($doc)); } $seite = new \goeranh\Seite('Antworten'); $inhalt = ' '; foreach ($users as $user){ $inhalt .= ''; foreach ($user->answers as $answers){ $inhalt .= ''; } } $inhalt .= '

'.$user->name.'

'.$answers->question.''.$answers->answer.'
'; $seite->addInhalt($inhalt); $seite->augeben(); } }