Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge v1.x into v2.x #1535

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 17 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,22 @@
}
}

if (! empty($this->options['modifiers'])) {
/** @psalm-var array|object */
$modifiers = $this->options['modifiers'];
$options['modifiers'] = is_object($modifiers) ? document_to_array($modifiers) : $modifiers;

Check failure on line 354 in src/Operation/Find.php

View workflow job for this annotation

GitHub Actions / Psalm

MixedAssignment

src/Operation/Find.php:354:13: MixedAssignment: Unable to determine the type of this assignment (see https://psalm.dev/032)

Check failure on line 354 in src/Operation/Find.php

View workflow job for this annotation

GitHub Actions / Psalm

UndefinedFunction

src/Operation/Find.php:354:61: UndefinedFunction: Function MongoDB\Operation\document_to_array does not exist (see https://psalm.dev/021)
}

GromNaN marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading