This is the default behavior.

A N1QL query that is using “Not Bounded” Scan Consistency means that it will not wait for any indexes to finish updating before running the query and returning results. Let’s say you have documents A,B,C in a bucket. At the time of the query, only A and B are indexed. With Not Bounded, only documents A and B will be returned.

Since the query is not waiting on any indexing, this is the best option for performance. Document C will show up once it has been indexed. This shouldn’t take long, but if you have just created C, for instance, and then immediately query for a full list of documents, C may not show up. To demonstrate with the travel-sample bucket:

private static void NotBoundedExample() { Console.WriteLine("========= NonBounded (default)"); // get the current count var result1 = _bucket.Query<dynamic>("SELECT COUNT(1) as airportCount FROM `travel-sample` WHERE type='airport'") .Rows.First(); Console.WriteLine($"Initial count: {result1.airportCount}"); // insert a new airport var doc = new Document<dynamic> { Id = "ScanConsistency::airport::" + _random.Next(10000), Content = new { type = "airport" } }; _bucket.Insert(doc); // get the count again var result2 = _bucket.Query<dynamic>("SELECT COUNT(1) as airportCount FROM `travel-sample` WHERE type='airport'") .Rows.First(); Console.WriteLine($"Count after insert: {result2.airportCount}"); // wait a few seconds and get the count again Console.Write("Waiting for 5 seconds..."); Thread.Sleep(5000); var result3 = _bucket.Query<dynamic>("SELECT COUNT(1) as airportCount FROM `travel-sample` WHERE type='airport'") .Rows.First(); Console.WriteLine($"Count after waiting: {result3.airportCount}"); } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 private static void NotBoundedExample ( ) { Console . WriteLine ( "========= NonBounded (default)" ) ; // get the current count var result1 = _bucket . Query < dynamic > ( "SELECT COUNT(1) as airportCount FROM `travel-sample` WHERE type='airport'" ) . Rows . First ( ) ; Console . WriteLine ( $ "Initial count: {result1.airportCount}" ) ; // insert a new airport var doc = new Document < dynamic > { Id = "ScanConsistency::airport::" + _random . Next ( 10000 ) , Content = new { type = "airport" } } ; _bucket . Insert ( doc ) ; // get the count again var result2 = _bucket . Query < dynamic > ( "SELECT COUNT(1) as airportCount FROM `travel-sample` WHERE type='airport'" ) . Rows . First ( ) ; Console . WriteLine ( $ "Count after insert: {result2.airportCount}" ) ; // wait a few seconds and get the count again Console . Write ( "Waiting for 5 seconds..." ) ; Thread . Sleep ( 5000 ) ; var result3 = _bucket . Query < dynamic > ( "SELECT COUNT(1) as airportCount FROM `travel-sample` WHERE type='airport'" ) . Rows . First ( ) ; Console . WriteLine ( $ "Count after waiting: {result3.airportCount}" ) ; }

What I would expect to see when running this code is:

Initial count: N Count after insert: N (still) Waiting Count after waiting: N+1