Skip to content

Commit fcd9b83

Browse files
Merge v1.x into v2.x (#1780)
2 parents cd3593b + 37f7f9a commit fcd9b83

File tree

53 files changed

+129
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+129
-173
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ jobs:
5353
with:
5454
submodules: true
5555

56+
- uses: actions/setup-python@v5
57+
with:
58+
python-version: '3.13'
59+
5660
- id: setup-mongodb
5761
uses: mongodb-labs/drivers-evergreen-tools@master
5862
with:

config.m4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ if test "$PHP_MONGODB" != "no"; then
298298
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/CheckHost.m4)
299299
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/PlatformFlags.m4)
300300

301-
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/CheckAtomics.m4)
302301
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/CheckHeaders.m4)
303302
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/Endian.m4)
304303
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/FindDependencies.m4)
@@ -312,7 +311,6 @@ if test "$PHP_MONGODB" != "no"; then
312311
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/Endian.m4)
313312
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/FindDependencies.m4)
314313
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/Versions.m4)
315-
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/WeakSymbols.m4)
316314

317315
dnl This include modifies the value of $PHP_MONGODB_CLIENT_SIDE_ENCRYPTION to "yes"
318316
dnl or "no" depending on whether dependencies for libmongocrypt are fulfilled

config.w32

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,16 @@ if (PHP_MONGODB != "no") {
130130
BSON_OS: 2,
131131
BSON_HAVE_STDBOOL_H: 0,
132132
BSON_HAVE_STRINGS_H: 0,
133-
BSON_HAVE_ATOMIC_32_ADD_AND_FETCH: 0,
134-
BSON_HAVE_ATOMIC_64_ADD_AND_FETCH: 0,
135-
BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES: 0,
136133
BSON_HAVE_CLOCK_GETTIME: 0,
137134
BSON_HAVE_STRNLEN: 0,
138135
BSON_HAVE_SNPRINTF: 0,
139136
BSON_HAVE_STRLCPY: 0,
140-
BSON_HAVE_REALLOCF: 0,
141-
BSON_NEEDS_SET_OUTPUT_FORMAT: 0,
142137
BSON_HAVE_TIMESPEC: 0,
143138
BSON_EXTRA_ALIGN: 0,
144-
BSON_HAVE_SYSCALL_TID: 0,
145-
BSON_HAVE_DECIMAL128: 0,
146139
BSON_HAVE_GMTIME_R: 0,
147-
BSON_HAVE_RAND_R: 0,
148-
BSON_HAVE_ARC4RANDOM_BUF: 0
140+
BSON_HAVE_RAND_R: 0
149141
};
150142

151-
if (CHECK_FUNC_IN_HEADER("stdio.h", "_set_output_format")) {
152-
bson_opts.BSON_NEEDS_SET_OUTPUT_FORMAT = 1;
153-
}
154-
155143
mongodb_generate_header(
156144
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-config.h.in",
157145
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-config.h",
@@ -187,7 +175,6 @@ if (PHP_MONGODB != "no") {
187175
MONGOC_ENABLE_MONGODB_AWS_AUTH: 0,
188176
MONGOC_ENABLE_SASL: 0,
189177
MONGOC_ENABLE_SASL_CYRUS: 0,
190-
MONGOC_ENABLE_SASL_GSSAPI: 0,
191178
MONGOC_ENABLE_SASL_SSPI: 0,
192179
MONGOC_ENABLE_SRV: 0,
193180
MONGOC_ENABLE_RDTSCP: 0,
@@ -196,7 +183,6 @@ if (PHP_MONGODB != "no") {
196183
MONGOC_HAVE_SASL_CLIENT_DONE: 0,
197184
MONGOC_HAVE_SCHED_GETCPU: 0,
198185
MONGOC_HAVE_SOCKLEN: 1,
199-
MONGOC_HAVE_WEAK_SYMBOLS: 0,
200186
MONGOC_NO_AUTOMATIC_GLOBALS: 1,
201187
MONGOC_SOCKET_ARG2: "struct sockaddr",
202188
MONGOC_SOCKET_ARG3: "socklen_t",
@@ -253,6 +239,10 @@ if (PHP_MONGODB != "no") {
253239
CHECK_HEADER_ADD_INCLUDE("sasl/sasl.h", "CFLAGS_MONGODB")) {
254240
mongoc_opts.MONGOC_ENABLE_SASL = 1;
255241
mongoc_opts.MONGOC_ENABLE_SASL_CYRUS = 1;
242+
243+
// Referenced by _mongoc_cyrus_verifyfile_cb in mongoc-cyrus.c on Windows
244+
ADD_FLAG("CFLAGS_MONGODB", "/D MONGOC_CYRUS_PLUGIN_PATH_PREFIX=NULL");
245+
256246
if (CHECK_FUNC_IN_HEADER("sasl/sasl.h", "sasl_client_done")) {
257247
mongoc_opts.MONGOC_HAVE_SASL_CLIENT_DONE = 1;
258248
}

sbom.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@
1919
"version": "1.12.0"
2020
},
2121
{
22-
"bom-ref": "pkg:github/mongodb/[email protected].0",
22+
"bom-ref": "pkg:github/mongodb/[email protected].2",
2323
"externalReferences": [
2424
{
2525
"type": "distribution",
26-
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.29.0.tar.gz"
26+
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.29.2.tar.gz"
2727
},
2828
{
2929
"type": "website",
30-
"url": "https://github.com/mongodb/mongo-c-driver/tree/1.29.0"
30+
"url": "https://github.com/mongodb/mongo-c-driver/tree/1.29.2"
3131
}
3232
],
3333
"group": "mongodb",
3434
"name": "mongo-c-driver",
35-
"purl": "pkg:github/mongodb/[email protected].0",
35+
"purl": "pkg:github/mongodb/[email protected].2",
3636
"type": "library",
37-
"version": "1.29.0"
37+
"version": "1.29.2"
3838
}
3939
],
4040
"dependencies": [
4141
{
4242
"ref": "pkg:github/mongodb/[email protected]"
4343
},
4444
{
45-
"ref": "pkg:github/mongodb/[email protected].0"
45+
"ref": "pkg:github/mongodb/[email protected].2"
4646
}
4747
],
4848
"metadata": {
49-
"timestamp": "2024-11-12T18:00:38.546484+00:00",
49+
"timestamp": "2025-01-14T14:24:24.250261+00:00",
5050
"tools": [
5151
{
5252
"externalReferences": [
@@ -90,7 +90,7 @@
9090
]
9191
},
9292
"serialNumber": "urn:uuid:acb30d08-ee47-4ff0-b301-d66ef1f54082",
93-
"version": 7,
93+
"version": 8,
9494
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
9595
"bomFormat": "CycloneDX",
9696
"specVersion": "1.5",

scripts/autotools/libbson/CheckAtomics.m4

Lines changed: 0 additions & 23 deletions
This file was deleted.

scripts/autotools/libbson/FindDependencies.m4

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,6 @@ if test "$bson_cv_have_strnlen" = yes; then
1313
AC_SUBST(BSON_HAVE_STRNLEN, 1)
1414
fi
1515

16-
# Check for reallocf() (BSD/Darwin)
17-
AC_SUBST(BSON_HAVE_REALLOCF, 0)
18-
AC_CACHE_CHECK([for reallocf],
19-
bson_cv_have_reallocf,
20-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
21-
#include <stdlib.h>
22-
int reallocf () { return 0; }
23-
]])],
24-
[bson_cv_have_reallocf=no],
25-
[bson_cv_have_reallocf=yes])])
26-
if test "$bson_cv_have_reallocf" = yes; then
27-
AC_SUBST(BSON_HAVE_REALLOCF, 1)
28-
fi
29-
30-
# Check for syscall()
31-
AC_SUBST(BSON_HAVE_SYSCALL_TID, 0)
32-
AC_CACHE_CHECK([for syscall],
33-
bson_cv_have_syscall_tid,
34-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
35-
#include <unistd.h>
36-
#include <sys/syscall.h>
37-
int syscall () { return 0; }
38-
]])],
39-
[bson_cv_have_syscall_tid=no],
40-
[bson_cv_have_syscall_tid=yes])])
41-
if test "$bson_cv_have_syscall_tid" = yes -a "$os_darwin" != "yes"; then
42-
AC_CACHE_CHECK([for SYS_gettid],
43-
bson_cv_have_sys_gettid_tid,
44-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
45-
#include <unistd.h>
46-
#include <sys/syscall.h>
47-
int gettid () { return SYS_gettid; }
48-
]])],
49-
[bson_cv_have_sys_gettid_tid=yes],
50-
[bson_cv_have_sys_gettid_tid=no])])
51-
if test "$bson_cv_have_sys_gettid_tid" = yes; then
52-
AC_SUBST(BSON_HAVE_SYSCALL_TID, 1)
53-
fi
54-
fi
55-
5616
# Check for snprintf()
5717
AC_SUBST(BSON_HAVE_SNPRINTF, 0)
5818
AC_CHECK_FUNC(snprintf, [AC_SUBST(BSON_HAVE_SNPRINTF, 1)])
@@ -79,10 +39,6 @@ AC_CHECK_FUNC(gmtime_r, [AC_SUBST(BSON_HAVE_GMTIME_R, 1)])
7939
AC_SUBST(BSON_HAVE_RAND_R, 0)
8040
AC_CHECK_FUNC(rand_r, [AC_SUBST(BSON_HAVE_RAND_R, 1)])
8141

82-
# Check for arc4random_buf()
83-
AC_SUBST(BSON_HAVE_ARC4RANDOM_BUF, 0)
84-
AC_CHECK_FUNC(arc4random_buf, [AC_SUBST(BSON_HAVE_ARC4RANDOM_BUF, 1)])
85-
8642
# Check for pthreads. We might need to make this better to handle mingw,
8743
# but I actually think it is okay to just check for it even though we will
8844
# use win32 primatives.
@@ -96,26 +52,3 @@ AX_PTHREAD([
9652
],[
9753
AC_MSG_ERROR([libbson requires pthreads on non-Windows platforms.])
9854
])
99-
100-
101-
# The following is borrowed from the guile configure script.
102-
#
103-
# On past versions of Solaris, believe 8 through 10 at least, you
104-
# had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
105-
# This is contrary to POSIX:
106-
# http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
107-
# Check here if this style is required.
108-
#
109-
# glibc (2.3.6 at least) works both with or without braces, so the
110-
# test checks whether it works without.
111-
#
112-
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 0)
113-
AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
114-
bson_cv_need_braces_on_pthread_once_init,
115-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
116-
pthread_once_t foo = PTHREAD_ONCE_INIT;]])],
117-
[bson_cv_need_braces_on_pthread_once_init=no],
118-
[bson_cv_need_braces_on_pthread_once_init=yes])])
119-
if test "$bson_cv_need_braces_on_pthread_once_init" = yes; then
120-
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 1)
121-
fi

scripts/autotools/libmongoc/WeakSymbols.m4

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/LIBMONGOC_VERSION_CURRENT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.29.0
1+
1.29.2

src/phongo_util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ zval* php_phongo_prep_legacy_option(zval* options, const char* key, bool* alloca
9292
Z_ADDREF_P(options);
9393
*allocated = true;
9494

95+
php_error_docref(NULL, E_DEPRECATED, "Passing the \"%s\" option directly is deprecated and will be removed in ext-mongodb 2.0", key);
96+
9597
return new_options;
9698
}
9799

tests/bson/bson-encode-001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ foreach($tests as $n => $test) {
3939
?>
4040
===DONE===
4141
<?php exit(0); ?>
42-
--EXPECT--
42+
--EXPECTF--
4343
Test#0 { "hello" : "world" }
4444
0 : 16 00 00 00 02 68 65 6c 6c 6f 00 06 00 00 00 77 [.....hello.....w]
4545
10 : 6f 72 6c 64 00 00 [orld..]
@@ -98,7 +98,7 @@ Test#16 { "foo" : "test", "0" : "foo", "1" : "bar" }
9898
0 : 29 00 00 00 02 66 6f 6f 00 05 00 00 00 74 65 73 [)....foo.....tes]
9999
10 : 74 00 02 30 00 04 00 00 00 66 6f 6f 00 02 31 00 [t..0.....foo..1.]
100100
20 : 04 00 00 00 62 61 72 00 00 [....bar..]
101-
Test#17 { "int" : { "$numberInt" : "3" }, "boolean" : true, "array" : [ "foo", "bar" ], "object" : { }, "string" : "test", "3" : "test" }
101+
Test#17 { "int" : { "$numberInt" : "3" }, "boolean" : true, "array" : [ "foo", "bar" ], "object" : { %w}, "string" : "test", "3" : "test" }
102102
0 : 64 00 00 00 10 69 6e 74 00 03 00 00 00 08 62 6f [d....int......bo]
103103
10 : 6f 6c 65 61 6e 00 01 04 61 72 72 61 79 00 1b 00 [olean...array...]
104104
20 : 00 00 02 30 00 04 00 00 00 66 6f 6f 00 02 31 00 [...0.....foo..1.]
@@ -123,7 +123,7 @@ Test#21 { "0" : { "foo" : "test", "0" : "foo", "1" : "bar" } }
123123
10 : 05 00 00 00 74 65 73 74 00 02 30 00 04 00 00 00 [....test..0.....]
124124
20 : 66 6f 6f 00 02 31 00 04 00 00 00 62 61 72 00 00 [foo..1.....bar..]
125125
30 : 00 [.]
126-
Test#22 { "0" : { "int" : { "$numberInt" : "3" }, "boolean" : true, "array" : [ "foo", "bar" ], "object" : { }, "string" : "test", "3" : "test" } }
126+
Test#22 { "0" : { "int" : { "$numberInt" : "3" }, "boolean" : true, "array" : [ "foo", "bar" ], "object" : { %w}, "string" : "test", "3" : "test" } }
127127
0 : 6c 00 00 00 03 30 00 64 00 00 00 10 69 6e 74 00 [l....0.d....int.]
128128
10 : 03 00 00 00 08 62 6f 6f 6c 65 61 6e 00 01 04 61 [.....boolean...a]
129129
20 : 72 72 61 79 00 1b 00 00 00 02 30 00 04 00 00 00 [rray......0.....]

tests/bson/bson-encode-004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ object(Person)#%d (5) {
7171
["secret":protected]=>
7272
string(24) "Hannes confidential info"
7373
}
74-
Test { "0" : { "__pclass" : { "$binary" : { "base64" : "UGVyc29u", "subType" : "80" } }, "name" : "Hannes", "age" : { "$numberInt" : "42" }, "addresses" : [ { "__pclass" : { "$binary" : { "base64" : "QWRkcmVzcw==", "subType" : "80" } }, "zip" : { "$numberInt" : "94086" }, "country" : "USA" }, { "__pclass" : { "$binary" : { "base64" : "QWRkcmVzcw==", "subType" : "80" } }, "zip" : { "$numberInt" : "200" }, "country" : "Iceland" } ], "friends" : [ { "__pclass" : { "$binary" : { "base64" : "UGVyc29u", "subType" : "80" } }, "name" : "Jeremy", "age" : { "$numberInt" : "21" }, "addresses" : [ ], "friends" : [ ] } ] } }
74+
Test { "0" : { "__pclass" : { "$binary" : { "base64" : "UGVyc29u", "subType" : "80" } }, "name" : "Hannes", "age" : { "$numberInt" : "42" }, "addresses" : [ { "__pclass" : { "$binary" : { "base64" : "QWRkcmVzcw==", "subType" : "80" } }, "zip" : { "$numberInt" : "94086" }, "country" : "USA" }, { "__pclass" : { "$binary" : { "base64" : "QWRkcmVzcw==", "subType" : "80" } }, "zip" : { "$numberInt" : "200" }, "country" : "Iceland" } ], "friends" : [ { "__pclass" : { "$binary" : { "base64" : "UGVyc29u", "subType" : "80" } }, "name" : "Jeremy", "age" : { "$numberInt" : "21" }, "addresses" : [ %w], "friends" : [ %w] } ] } }
7575
0 : 23 01 00 00 03 30 00 1b 01 00 00 05 5f 5f 70 63 [#....0......__pc]
7676
10 : 6c 61 73 73 00 06 00 00 00 80 50 65 72 73 6f 6e [lass......Person]
7777
20 : 02 6e 61 6d 65 00 07 00 00 00 48 61 6e 6e 65 73 [.name.....Hannes]

tests/bson/bson-encode-005.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var_dump($ret);
1919
===DONE===
2020
<?php exit(0); ?>
2121
--EXPECTF--
22-
Test { "emptyarray" : [ ], "emptyclass" : { } }
22+
Test { "emptyarray" : [ %w], "emptyclass" : { %w} }
2323
0 : 27 00 00 00 04 65 6d 70 74 79 61 72 72 61 79 00 ['....emptyarray.]
2424
10 : 05 00 00 00 00 03 65 6d 70 74 79 63 6c 61 73 73 [......emptyclass]
2525
20 : 00 05 00 00 00 00 00 [.......]

tests/bulk/write-0002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $w = 1;
2121
$wtimeout = 1000;
2222
$writeConcern = new \MongoDB\Driver\WriteConcern($w, $wtimeout);
2323
var_dump($insertBulk);
24-
$result = $manager->executeBulkWrite(NS, $insertBulk, $writeConcern);
24+
$result = $manager->executeBulkWrite(NS, $insertBulk, ['writeConcern' => $writeConcern]);
2525
var_dump($insertBulk);
2626

2727
assert($result instanceof \MongoDB\Driver\WriteResult);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
MongoDB\Driver\Manager::executeBulkWrite() explicit WriteConcern argument is deprecated
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
7+
--FILE--
8+
<?php
9+
10+
require_once __DIR__ . "/../utils/basic.inc";
11+
12+
$manager = create_test_manager();
13+
14+
$bulk = new MongoDB\Driver\BulkWrite();
15+
$bulk->insert(['_id' => 1]);
16+
$manager->executeBulkWrite(NS, $bulk, new MongoDB\Driver\WriteConcern(0));
17+
18+
?>
19+
===DONE===
20+
<?php exit(0); ?>
21+
--EXPECTF--
22+
Deprecated: MongoDB\Driver\Manager::executeBulkWrite(): Passing the "writeConcern" option directly is deprecated and will be removed in ext-mongodb 2.0%s
23+
===DONE===

tests/manager/manager-executeBulkWrite_error-003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $bulk = new MongoDB\Driver\BulkWrite();
1414
$bulk->insert(array('_id' => 1, 'x' => 1));
1515

1616
try {
17-
$manager->executeBulkWrite(NS, $bulk, new MongoDB\Driver\WriteConcern(30));
17+
$manager->executeBulkWrite(NS, $bulk, ['writeConcern' => new MongoDB\Driver\WriteConcern(30)]);
1818
} catch (MongoDB\Driver\Exception\BulkWriteException $e) {
1919
printf("BulkWriteException: %s\n", $e->getMessage());
2020

tests/manager/manager-executeCommand-003.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ echo "is_secondary: ", $cursor->getServer()->isSecondary() ? 'true' : 'false', "
3232
<?php exit(0); ?>
3333
--EXPECTF--
3434
Testing primary:
35+
36+
Deprecated: MongoDB\Driver\Manager::executeCommand(): Passing the "readPreference" option directly is deprecated and will be removed in ext-mongodb 2.0%s
3537
is_primary: true
3638
is_secondary: false
3739

3840
Testing secondary:
41+
42+
Deprecated: MongoDB\Driver\Manager::executeCommand(): Passing the "readPreference" option directly is deprecated and will be removed in ext-mongodb 2.0%s
3943
is_primary: false
4044
is_secondary: true
4145

tests/manager/manager-executeQuery-004.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ echo "is_secondary: ", $cursor->getServer()->isSecondary() ? 'true' : 'false', "
3737
<?php exit(0); ?>
3838
--EXPECTF--
3939
Testing primary:
40+
41+
Deprecated: MongoDB\Driver\Manager::executeQuery(): Passing the "readPreference" option directly is deprecated and will be removed in ext-mongodb 2.0%s
4042
is_primary: true
4143
is_secondary: false
4244

4345
Testing secondary:
46+
47+
Deprecated: MongoDB\Driver\Manager::executeQuery(): Passing the "readPreference" option directly is deprecated and will be removed in ext-mongodb 2.0%s
4448
is_primary: false
4549
is_secondary: true
4650

tests/readPreference/bug0146-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $rps = [
2626

2727
foreach($rps as $r) {
2828
$rp = new MongoDB\Driver\ReadPreference($r);
29-
$cursor = $manager->executeQuery(NS, new MongoDB\Driver\Query(array("my" => "query")), $rp);
29+
$cursor = $manager->executeQuery(NS, new MongoDB\Driver\Query(['my' => 'query']), ['readPreference' => $rp]);
3030
var_dump($cursor);
3131
}
3232

0 commit comments

Comments
 (0)