N1ql consistentWith PHP sdk 4.0

Hello,

Previosuly i was using PHP SDK 2.6 where below of my code was working. Now i am migrating to PHP SDK 4.0 where i am facing issue to run below code.

$mutationState = $this->data_connector->insert($key, $data);

    $opts = new \Couchbase\QueryOptions();
    $opts->consistentWith($mutationState);

    $result = $this->cluster->query($query, $opts);
    $r = $result->rows();

incase anybody wants

$mutationResult = $this->data_connector->insert($key, $data);

                $m = new \Couchbase\MutationState();
                $mutationState = $m->add($mutationResult);

                $opts = new \Couchbase\QueryOptions();
                $opts->consistentWith($mutationState);

                $result = $this->cluster->query($sql, $opts);
                $r = $result->rows();