1<?php
2$cluster = new \Couchbase\Cluster('couchbase://localhost?fetch_mutation_tokens=true');
3$bucket = $cluster->openBucket('default');
4
5$doc = $bucket->upsert("foo", ['answer' => 42]);
6$mutationState = \Couchbase\MutationState::from($doc);
7
8$query = \Couchbase\N1qlQuery::fromString("SELECT * FROM `default` WHERE answer=42");
9$result = $query->consistentWith($mutationState);
10// the $result should contain information from "foo"