Skip to content

Commit

Permalink
Merge v1.x into v2.x (#1535)
Browse files Browse the repository at this point in the history
  • Loading branch information
mongodb-php-bot authored Nov 25, 2024
2 parents 679caa6 + b77c255 commit 470c2c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/atlas_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* This example demonstrates how to create an Atlas Search index and perform a search query.
* It requires a MongoDB Atlas M10+ cluster with Sample Dataset loaded.
* It requires a MongoDB Atlas cluster with Sample Dataset loaded.
*
* Use the MONGODB_URI environment variable to specify the connection string from the Atlas UI.
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Operation/Find.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use MongoDB\Exception\UnsupportedException;
use MongoDB\Model\CodecCursor;

use function assert;
use function is_array;
use function is_bool;
use function is_integer;
Expand Down Expand Up @@ -347,6 +348,16 @@ private function createQueryOptions(): array
}
}

// Ensure no cursor is left behind when limit == batchSize by increasing batchSize
if (isset($options['limit'], $options['batchSize']) && $options['limit'] === $options['batchSize']) {
assert(is_integer($options['batchSize']));
$options['batchSize']++;
}

if (isset($options['limit']) && $options['limit'] === 1) {
$options['singleBatch'] = true;
}

return $options;
}
}
2 changes: 1 addition & 1 deletion tests/ExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public static function provideExamples(): Generator
}

/**
* MongoDB Atlas Search example requires a MongoDB Atlas M10+ cluster with MongoDB 7.0+
* MongoDB Atlas Search example requires a MongoDB Atlas cluster with MongoDB 7.0+
* Tips for insiders: if using a cloud-dev server, append ".mongodb.net" to the MONGODB_URI.
*/
#[Group('atlas')]
Expand Down
2 changes: 1 addition & 1 deletion tests/specifications
Submodule specifications updated 65 files
+4 −4 source/connection-monitoring-and-pooling/tests/cmap-format/pool-create-min-size-error.json
+2 −2 source/connection-monitoring-and-pooling/tests/cmap-format/pool-create-min-size-error.yml
+32 −13 source/crud/crud.md
+148 −0 source/crud/tests/unified/bulkWrite-updateMany-pipeline.json
+67 −0 source/crud/tests/unified/bulkWrite-updateMany-pipeline.yml
+156 −0 source/crud/tests/unified/bulkWrite-updateOne-pipeline.json
+66 −0 source/crud/tests/unified/bulkWrite-updateOne-pipeline.yml
+62 −0 source/crud/tests/unified/find.json
+28 −0 source/crud/tests/unified/find.yml
+158 −0 source/crud/tests/unified/findOne.json
+75 −0 source/crud/tests/unified/findOne.yml
+130 −0 source/crud/tests/unified/findOneAndUpdate-pipeline.json
+56 −0 source/crud/tests/unified/findOneAndUpdate-pipeline.yml
+142 −0 source/crud/tests/unified/updateMany-pipeline.json
+64 −0 source/crud/tests/unified/updateMany-pipeline.yml
+150 −0 source/crud/tests/unified/updateOne-pipeline.json
+64 −0 source/crud/tests/unified/updateOne-pipeline.yml
+0 −494 source/crud/tests/unified/updateWithPipelines.json
+0 −296 source/crud/tests/unified/updateWithPipelines.yml
+1 −1 source/logging/logging.md
+5 −20 source/read-write-concern/read-write-concern.md
+5 −36 source/retryable-writes/tests/README.md
+144 −0 source/retryable-writes/tests/unified/aggregate-out-merge.json
+65 −0 source/retryable-writes/tests/unified/aggregate-out-merge.yml
+153 −1 source/retryable-writes/tests/unified/bulkWrite.json
+64 −0 source/retryable-writes/tests/unified/bulkWrite.yml
+12 −3 source/retryable-writes/tests/unified/client-bulkWrite-serverErrors.json
+3 −0 source/retryable-writes/tests/unified/client-bulkWrite-serverErrors.yml
+21 −1 source/retryable-writes/tests/unified/deleteMany.json
+8 −0 source/retryable-writes/tests/unified/deleteMany.yml
+31 −1 source/retryable-writes/tests/unified/deleteOne.json
+12 −0 source/retryable-writes/tests/unified/deleteOne.yml
+31 −1 source/retryable-writes/tests/unified/findOneAndDelete.json
+12 −0 source/retryable-writes/tests/unified/findOneAndDelete.yml
+31 −1 source/retryable-writes/tests/unified/findOneAndReplace.json
+12 −0 source/retryable-writes/tests/unified/findOneAndReplace.yml
+31 −1 source/retryable-writes/tests/unified/findOneAndUpdate.json
+12 −0 source/retryable-writes/tests/unified/findOneAndUpdate.yml
+58 −1 source/retryable-writes/tests/unified/insertMany.json
+23 −0 source/retryable-writes/tests/unified/insertMany.yml
+31 −1 source/retryable-writes/tests/unified/insertOne.json
+12 −0 source/retryable-writes/tests/unified/insertOne.yml
+31 −1 source/retryable-writes/tests/unified/replaceOne.json
+12 −0 source/retryable-writes/tests/unified/replaceOne.yml
+77 −0 source/retryable-writes/tests/unified/unacknowledged-write-concern.json
+40 −0 source/retryable-writes/tests/unified/unacknowledged-write-concern.yml
+21 −1 source/retryable-writes/tests/unified/updateMany.json
+8 −0 source/retryable-writes/tests/unified/updateMany.yml
+31 −1 source/retryable-writes/tests/unified/updateOne.json
+12 −0 source/retryable-writes/tests/unified/updateOne.yml
+0 −12 source/server-discovery-and-monitoring/server-discovery-and-monitoring-tests.md
+9 −7 source/server-discovery-and-monitoring/server-discovery-and-monitoring.md
+4 −0 source/server-discovery-and-monitoring/tests/unified/logging-replicaset.json
+4 −4 source/server-discovery-and-monitoring/tests/unified/logging-replicaset.yml
+2 −0 source/server-discovery-and-monitoring/tests/unified/logging-sharded.json
+2 −2 source/server-discovery-and-monitoring/tests/unified/logging-sharded.yml
+2 −0 source/server-discovery-and-monitoring/tests/unified/logging-standalone.json
+2 −2 source/server-discovery-and-monitoring/tests/unified/logging-standalone.yml
+149 −0 source/server-discovery-and-monitoring/tests/unified/pool-clear-application-error.json
+88 −0 source/server-discovery-and-monitoring/tests/unified/pool-clear-application-error.yml
+296 −0 source/server-discovery-and-monitoring/tests/unified/pool-clear-checkout-error.json
+176 −0 source/server-discovery-and-monitoring/tests/unified/pool-clear-checkout-error.yml
+230 −0 source/server-discovery-and-monitoring/tests/unified/pool-clear-min-pool-size-error.json
+144 −0 source/server-discovery-and-monitoring/tests/unified/pool-clear-min-pool-size-error.yml
+4 −1 source/server_write_commands/server_write_commands.md

0 comments on commit 470c2c8

Please sign in to comment.