It supports all new features for MongoDB 2.6, including:
Aggregate can now return a cursor
Aggregation pipelines can now be explained
Possible to set maxTimeMS for commands and queries
Transparent support for the new command-based MongoDB write API
New MongoWriteBatch classes (using the new MongoDB write API)
Support for MongoDB Enterprise features (e.g. Kerberos, LDAP, X509)
Option to tune acceptable server latency for secondary reads (secondaryAcceptableLatencyMS)
With this release, some driver functionality which was previously
documented as deprecated will now formally raise deprecation notices. This
includes:
Instantiating the Mongo class
Calling MongoCursor::slaveOkay()
"wtimeout" and "safe" options for MongoCollection write operations
Manipulating public properties on core classes (such as $collection->w)
Note:
No previously deprecated features have been removed.
Changes in behaviour:
Setting the mongo.native_long INI setting now raises an error on 32-bit
platforms, and now defaults to true for 64-bit platforms.
MongoDB PHP Driver 1.4.0
The 1.4 series introduced fundemental changes in how connections are created to the MongoDB servers.
The driver now utilizes PHP native streams, so all normal PHP stream options apply.
Furthermore, an experimental Stream Context Support was added.
The 1.4.x series also added support for MongoDB 2.4.x.
The most important improvements however deal with the handling of replica sets,
especially nodes that timeout and nodes that are unreachable for various
reasons. Besides the improvements to replica set handling, this release
addresses issues with read preferences through mongos nodes. It also
adds support for SSL enabled connections as well as journal and fsync
connection string options.
MongoDB PHP Driver 1.3.0
The 1.3 series introduced several major changes to the extension such as
completely rewritten connection
handling (and removal of the pooling mechanism), support for
ReadPreferences and change the
default WriteConcerns to be
acknowledged by introducing a new class
MongoClient which serves as a
replacement class for the now deprecated Mongo class.
The driver now also supports connecting to multiple mongos instances (the
Mongo Shard router) for loadbalancing.
Added the "wTimeoutMS" option, which replaces
"wtimeout". Emits E_DEPRECATED
when "wtimeout" is used.
Added the "socketTimeoutMS" option, which replaces
"timeout". Emits E_DEPRECATED
when "timeout" is used.
Emits E_DEPRECATED when "safe"
is used.
Renamed the "wtimeout" option to
"wTimeoutMS". Emits
E_DEPRECATED when "wtimeout" is
used.
Renamed the "timeout" option to
"socketTimeoutMS". Emits
E_DEPRECATED when "timeout" is
used.
Emits E_DEPRECATED when "safe"
is used.
Added the "wTimeoutMS" option, which replaces
"wtimeout". Emits E_DEPRECATED
when "wtimeout" is used.
Added the "socketTimeoutMS" option, which replaces
"timeout". Emits E_DEPRECATED
when "timeout" is used.
Emits E_DEPRECATED when "safe"
is used.
Added "wTimeoutMS" option, which replaces
"wtimeout". Emits E_DEPRECATED
when "wtimeout" is used.
Added "socketTimeoutMS" option, which replaces
"timeout". Emits E_DEPRECATED
when "timeout" is used.
Emits E_DEPRECATED when "safe"
is used.
Added "wTimeoutMS" option, which replaces
"wtimeout". Emits E_DEPRECATED
when "wtimeout" is used.
Added "socketTimeoutMS" option, which replaces
"timeout". Emits E_DEPRECATED
when "timeout" is used.
Emits E_DEPRECATED when "safe"
is used.
Added the "wTimeoutMS" option, which replaces
"wtimeout". Emits E_DEPRECATED
when "wtimeout" is used.
Added the "socketTimeoutMS" option, which replaces
"timeout". Emits E_DEPRECATED
when "timeout" is used.
Emits E_DEPRECATED when "safe"
is used.
Added "ssl" option and support for
connecting over SSL.
Added "wTimeoutMS" option, which replaces
"wTimeout".
Emits E_DEPRECATED when
"slaveOkay" or "timeout" is used.
In versions before 1.4.0, the options were all arguments to the method. The
function synopsis in those older versions is:
public MongoCollectionMongoDB::createCollection
stringname
boolcappedFALSE
intsize0
intmax0
The meaning of the options is the same as described under the
options argument above.
The return value has changed to be consistent with
MongoClient::setReadPreference. The
type value was changed from a number to a string,
type_string was removed, and
tagsets now expresses tags as key/value pairs instead
of colon-delimited strings.
The return value has changed to be consistent with
MongoCollection::setReadPreference. The
type value was changed from a number to a string,
type_string was removed, and
tagsets now expresses tags as key/value pairs instead
of colon-delimited strings.
The return value has changed to be consistent with
MongoDB::setReadPreference. The
type value was changed from a number to a string,
type_string was removed, and
tagsets now expresses tags as key/value pairs instead
of colon-delimited strings.
Added "w" option.
The options parameter no longer accepts a
boolean to signify a unique index. Instead, this now has to be done
with array('unique' => true).
Added "w" option.
The options parameter no longer accepts a
boolean to signify an acknowledged write. Instead, this now has to be
done with array('w' => 1) (the default behaviour of
MongoClient).
Added "w" option.
The options parameter no longer accepts a
boolean to signify "justOne". Instead, this now has
to be done with array('justOne' => true).
Added "w" option.
The options parameter no longer accepts a boolean
to signify an upsert. Instead, this now has to be done with
array('upsert' => true).
Before version 1.2.0 the driver would not use persistent connections
by default, and all connections would be closed as soon as a MongoDB
connection went out if scope. Since version 1.2.0 this is no longer
the case and it is a bad idea to call close as you might end up
overloading the server with connections under high load.
Added "username" and "password"
options.
Removed "persist" option, as all connections are
now persistent. It can still be used, but it doesn't affect anything.
"persist"
If the connection should be persistent. If set, the connection will
be persistent. The string representation of the value is used as an
ID for the connection, so two instances of
MongoClient that are initialized with
array("persist" => "foobar") will share the same
database connection, whereas an instance initialized with
array("persist" => "barbaz") will use a different
database connection.
The "replicaSet" option now takes a string, not a
boolean.
Added a number of other fields, including id (the
cursor id), at (the driver's counter of which
document is current), numReturned (the number
returned by the server in the current batch), and
server (which server the query was sent
to—useful in conjunction with
.
The "safe" option will trigger a primary failover,
if necessary.
MongoException will be thrown if the index name
(either generated or set) is longer than 128 bytes.
Added ability to pass integers to the "safe" option,
which previously only accepted booleans.
Added "fsync" option.
The return type was changed to be an array containing error information
if the "safe" option is used. Otherwise, a boolean
is returned as before.
Added ability to pass integers to the "safe" option,
which previously only accepted booleans.
Added "fsync" option.
The return type was changed to be an array containing error information
if the "safe" option is used. Otherwise, a boolean
is returned as before.
Added ability to pass integers to the "safe" option,
which previously only accepted booleans.
Added "fsync" option.
The return type was changed to be an array containing error information
if the "safe" option is used. Otherwise, a boolean
is returned as before.
Changed constructor to take an array of options. Pre-1.0.2, the
constructor took the following parameters:
server
The server name.
connect
Optional boolean parameter specifying if the constructor should
connect to the database before returning. Defaults to TRUE.
persistent
If the connection should be persistent.
paired
If the connection should be paired.