锟皆憋拷锟斤拷展锟斤拷锟洁/锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟铰革拷锟铰★拷
It supports all new features for MongoDB 2.6, including:
With this release, some driver functionality which was previously documented as deprecated will now formally raise deprecation notices. This includes:
Note:
No previously deprecated features have been removed.
Changes in behaviour:
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.
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.
Other enhancements include improved logging for easier connection handling debugging with MongoLog and support for the » Aggregation Framework via the MongoCollection::aggregate() method.
Following is a list of all improvements to existing methods since their inception.
Version | Function | Description |
---|---|---|
1.6.0 | MongoDB::getCollectionNames | Changed first parameter to be an array of options. Pre-1.6.0, the first parameter was a boolean indicating the "includeSystemCollections" option. |
MongoDB::listCollections | Changed first parameter to be an array of options. Pre-1.6.0, the first parameter was a boolean indicating the "includeSystemCollections" option. | |
1.5.0 | log_cmd_delete | Only available when connected to MongoDB 2.6.0+ |
log_cmd_insert | Only available when connected to MongoDB 2.6.0+ | |
log_cmd_update | Only available when connected to MongoDB 2.6.0+ | |
log_write_batch | Only available when connected to MongoDB 2.6.0+ | |
MongoBinData::__construct | 默锟斤拷值锟斤拷 2 (MongoBinData::BYTE_ARRAY) 锟侥筹拷 0 (MongoBinData::GENERIC)锟斤拷 | |
MongoCollection::aggregate | Added optional options argument | |
MongoCollection::batchInsert | 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. | |
MongoCollection::ensureIndex | 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. | |
MongoCollection::findOne | Added optional options argument. | |
MongoCollection::group | Added "maxTimeMS" option. | |
MongoCollection::save | 锟斤拷锟斤拷 "wTimeoutMS" 选锟斤拷锟斤拷锟斤拷锟斤拷 "wtimeout"锟斤拷 使锟斤拷 "wtimeout" 时锟斤拷锟斤拷 E_DEPRECATED 锟斤拷锟斤拷 锟斤拷锟斤拷 "socketTimeoutMS" 选锟斤拷锟斤拷锟斤拷锟斤拷 "timeout"锟斤拷 使锟斤拷 "timeout" 时锟斤拷锟斤拷 E_DEPRECATED 锟斤拷锟斤拷 使锟斤拷 "safe" 时锟斤拷锟斤拷 E_DEPRECATED 锟斤拷锟斤拷 | |
MongoCollection::toIndexString | This method has been deprecated. | |
MongoCollection::update | 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. | |
MongoCursor::slaveOkay | This method has been deprecated in favour of MongoCursor::setReadPreference and . | |
1.4.5 | MongoCursor::batchSize | Before 1.4.5, this method would throw an MongoCursorException if the cursor had already started iterating. |
1.4.0 | MongoCursor::hint | The index argument now supports index names as string values. In versions before 1.4.0, only array or object values were accepted. |
MongoCursor::setFlag | Support for flag 3 (OPLOG_REPLAY) is added. Versions before 1.4.0 would throw a warning saying that the flag is unsupported. | |
MongoDB::createCollection | 1.4.0锟斤拷前锟侥版本锟斤,锟斤拷锟斤拷选锟筋都锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷牟锟斤拷锟斤拷锟街帮拷姹撅拷锟斤拷锟斤拷锟斤拷锟斤拷签锟斤拷锟斤拷锟斤拷锟斤拷锟侥o拷 public MongoCollectionMongoDB::createCollection stringname boolcappedFALSE intsize0 intmax0 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟节版本锟斤拷 options 锟斤拷锟斤拷锟斤拷同锟斤拷 | |
MongoId::__construct | 锟斤拷锟斤拷锟斤拷效锟街凤拷锟斤拷锟阶筹拷锟届常 | |
1.3.4 | MongoClient::__construct | 锟斤拷锟斤拷锟� "connectTimeoutMS" 锟斤拷 "socketTimeoutMS" 选锟筋。 |
MongoCollection::batchInsert | Added "wtimeout" option. | |
MongoCollection::ensureIndex | Added "wtimeout" option. | |
MongoCollection::update | Added "wtimeout" option. | |
1.3.3 | MongoClient::getReadPreference | 锟斤拷锟截碉拷值锟睫革拷为锟斤拷锟斤拷 MongoClient::setReadPreference锟斤拷 type 锟斤拷值锟斤拷锟斤拷锟斤拷某锟斤拷址锟斤拷锟斤拷锟缴撅拷锟斤拷锟� type_string锟斤拷锟斤拷锟斤拷 tagsets 锟斤拷锟斤拷锟皆硷拷值锟斤拷示锟侥憋拷签锟斤拷锟斤拷锟斤拷冒锟脚分革拷锟斤拷锟街凤拷锟斤拷锟斤拷 |
MongoCollection::getReadPreference | 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. | |
MongoDB::getReadPreference | 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. | |
1.3.0 | MongoClient::close | 锟斤拷 1.3.0 锟芥本锟叫o拷为锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 connection 锟斤拷锟斤拷锟斤拷 锟节达拷之前锟斤拷直锟斤拷写锟斤拷锟斤拷锟接才会被锟斤拷锟斤拷锟斤拷锟斤拷乇铡锟� |
MongoClient::__construct | 锟斤拷锟斤拷锟� "readPreference"锟斤拷 "readPreferenceTags"锟斤拷"w" 锟斤拷 "wTimeout" 选锟筋。 | |
MongoCollection::batchInsert | Added "w" option. | |
MongoCollection::ensureIndex | 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). | |
MongoCollection::insert | options 锟斤拷锟斤拷锟斤拷锟劫斤拷锟斤拷 boolean 锟斤拷锟斤拷识一锟斤拷确锟较碉拷写锟诫。 锟斤拷锟节o拷锟斤拷锟斤拷锟酵拷锟� array('w' => 1) 锟斤拷锟矫o拷 MongoClient 默锟较碉拷锟斤拷为锟斤拷 | |
MongoCollection::remove | options 锟斤拷锟斤拷锟斤拷锟劫斤拷锟斤拷 boolean 值锟斤拷锟斤拷锟斤拷 "justOne"锟斤拷 锟斤拷锟节o拷锟斤拷锟斤拷使锟斤拷 array('justOne' => true) 锟斤拷为锟斤拷锟斤拷锟� | |
MongoCollection::update | 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). | |
MongoDB::listCollections | Added the includeSystemCollections parameter. | |
MongoGridFSCursor::key | The document's _id is returned as a string value, since the key should be unique. Pre-1.3.0, filename was returned. | |
1.2.11 | Mongo::getPoolSize | Emits E_DEPRECATED when used. |
Mongo::getSlave | Emits E_DEPRECATED when used. | |
Mongo::getSlaveOkay | Emits E_DEPRECATED when used. | |
Mongo::poolDebug | Emits E_DEPRECATED when used. | |
Mongo::setSlaveOkay | Emits E_DEPRECATED when used. | |
Mongo::switchSlave | Emits E_DEPRECATED when used. | |
MongoBinData::__construct | 没锟斤拷使锟矫第讹拷锟斤拷锟斤拷锟斤拷时锟斤拷锟斤拷 E_DEPRECATED锟斤拷 type 锟斤拷默锟斤拷值锟节斤拷锟节的癸拷锟斤拷锟斤拷锟斤拷芑锟侥变。 | |
MongoCollection::ensureIndex | Emits E_DEPRECATED when options is scalar. | |
MongoCollection::getSlaveOkay | Emits E_DEPRECATED when used. | |
MongoCollection::group | Emits E_DEPRECATED when options is scalar. | |
MongoCollection::remove | 锟斤拷 options 锟斤拷 scalar 时锟斤拷锟斤拷一锟斤拷 E_DEPRECATED 锟斤拷锟芥。 | |
MongoCollection::setSlaveOkay | Emits E_DEPRECATED when used. | |
MongoCollection::update | Emits E_DEPRECATED when options is scalar. | |
MongoCursor::doQuery | Emits E_DEPRECATED when used. | |
MongoDB::authenticate | 使锟斤拷时锟斤拷锟斤拷 E_DEPRECATED锟斤拷 锟诫将锟斤拷证细锟节达拷锟诫到锟斤拷锟斤拷锟斤拷锟斤拷 | |
MongoDB::forceError | Emits E_DEPRECATED when used. | |
MongoDB::getSlaveOkay | Emits E_DEPRECATED when used. | |
MongoDB::prevError | Emits E_DEPRECATED when used. | |
MongoDB::resetError | Emits E_DEPRECATED when used. | |
MongoDB::setSlaveOkay | Emits E_DEPRECATED when used. | |
MongoPool::getSize | Emits E_DEPRECATED when used. | |
MongoPool::info | Emits E_DEPRECATED when used. | |
MongoPool::setSize | Emits E_DEPRECATED when used. | |
1.2.10 | MongoClient::getHosts | 锟皆非硷拷群锟斤拷支锟街★拷 锟斤拷锟截碉拷锟斤拷锟斤拷元锟斤拷锟斤拷锟斤拷也锟斤拷锟斤拷锟斤拷 hostname 锟斤拷 port锟斤拷 |
1.2.7 | MongoCollection::batchInsert | Added "continueOnError" option. |
1.2.5 | MongoGridFS::storeUpload | Changed second parameter to an array of metadata. Pre-1.2.5, the second parameter was an optional string overriding the filename. |
1.2.0 | MongoClient::close | 锟节版本 1.2.0 之前锟斤拷锟斤拷锟斤拷锟斤拷锟侥拷喜锟斤拷锟绞癸拷贸志锟斤拷锟斤拷樱锟斤拷锟斤拷锟斤拷锟斤拷踊锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷时锟截闭★拷 锟斤拷锟节版本 1.2.0 锟斤拷锟斤拷锟斤拷锟斤拷锟剿o拷锟斤拷锟皆碉拷锟斤拷 close 锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟解,锟节凤拷锟斤拷锟斤拷锟叫较高革拷锟斤拷时锟斤拷锟杰伙拷锟斤拷筛锟斤拷叩锟窖癸拷锟斤拷锟� |
MongoClient::__construct | 锟斤拷锟斤拷锟� "username" 锟斤拷 "password" 选锟筋。 锟狡筹拷锟斤拷 "persist" 选锟筋,锟斤拷锟叫碉拷锟斤拷锟接讹拷锟角持久的★拷锟斤拷锟皆撅拷锟杰癸拷使锟矫o拷锟斤拷锟角诧拷锟斤拷锟斤拷锟矫★拷 "persist" 锟角凤拷应锟斤拷锟角持撅拷锟斤拷锟接★拷锟斤拷锟斤拷锟斤拷锟斤拷耍锟斤拷锟斤拷踊锟斤拷浅志锟斤拷锟斤拷印锟� 锟街凤拷锟斤拷式锟斤拷值锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟接碉拷 ID锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 array("persist" => "foobar") 锟斤拷始锟斤拷锟斤拷 MongoClient 实锟斤拷锟结共锟斤拷一锟斤拷锟斤拷锟捷匡拷锟斤拷锟接o拷锟斤拷 array("persist" => "barbaz")锟斤拷始锟斤拷锟斤拷实锟斤拷锟斤拷使锟矫诧拷同锟斤拷锟斤拷锟捷匡拷锟斤拷锟接★拷 "replicaSet" 选锟斤拷锟斤拷锟斤拷支锟斤拷一锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟角诧拷锟斤拷值锟斤拷 | |
MongoCollection::ensureIndex | Added "timeout" option. | |
MongoCollection::insert | 锟斤拷锟斤拷锟斤拷 "timeout" 选锟筋。 | |
MongoCollection::remove | 锟斤拷锟� "timeout" 选锟筋。 | |
MongoCollection::save | 锟斤拷锟斤拷 "timeout" 选锟筋。 | |
MongoCollection::update | Added "timeout" option. | |
MongoDB::command | 锟斤拷锟� options 锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷选锟斤拷:"timeout"锟斤拷 | |
1.1.0 | MongoCursor::info | 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 . |
1.0.11 | MongoCollection::ensureIndex | 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. |
MongoCollection::insert | 锟斤拷锟斤拷锟斤拷锟斤拷锟� "safe"锟斤拷锟斤拷锟斤拷 "not master" 锟斤拷锟斤拷时锟较匡拷锟斤拷锟接★拷 | |
MongoCollection::remove | 锟斤拷锟斤拷锟斤拷锟斤拷 "safe" 之锟襟,斤拷锟节筹拷锟斤拷 "not master" 锟斤拷锟斤拷时锟较匡拷锟斤拷锟接★拷 | |
MongoCollection::save | 锟斤拷锟斤拷 "safe" 时锟斤拷锟斤拷锟斤拷锟斤拷 "not master" 锟斤拷锟斤拷时锟斤拷锟斤拷锟较匡拷锟斤拷锟接★拷 | |
MongoCollection::update | Disconnects on "not master" errors if "safe" is set. | |
1.0.10 | MongoCursor::info | Added started_iterating field, a boolean indicating if cursor is pre- or post-query. |
1.0.9 | MongoClient::__construct | 锟斤拷锟斤拷锟� "replicaSet" 选锟筋。 |
MongoCollection::batchInsert | Added ability to pass integers to the "safe" option, which previously only accepted booleans. Added "fsync" option. | |
MongoCollection::insert | "safe" 选锟斤拷锟斤拷锟� integer 值锟斤拷之前只锟斤拷锟斤拷 boolean 值锟斤拷 锟斤拷锟斤拷 "fsync" 选锟筋。 锟斤拷锟斤拷锟斤拷锟斤拷锟� "safe" 选锟筋,锟斤拷锟斤拷锟斤拷锟酵改成帮拷锟斤拷锟斤拷锟斤拷锟斤拷息锟斤拷 array锟斤拷 锟斤拷锟津,猴拷之前一锟斤拷锟斤拷锟斤拷 boolean锟斤拷 | |
MongoCollection::remove | 锟斤拷锟斤拷锟� "safe" 选锟斤拷锟� integer 锟斤拷支锟街o拷之前只锟斤拷锟斤拷 boolean 值锟斤拷 锟斤拷锟斤拷锟� "fsync" 选锟筋。 锟斤拷使锟斤拷锟斤拷 "safe" 选锟斤拷时锟斤拷锟结返锟截帮拷锟斤拷锟斤拷锟斤拷锟斤拷息锟斤拷锟斤拷锟介。 锟斤拷锟斤拷锟街耙伙拷锟斤拷锟斤拷锟揭伙拷锟� boolean锟斤拷 | |
MongoCollection::save | 锟斤拷锟斤拷 "fsync" 选锟筋。 | |
MongoCollection::update | 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. | |
1.0.7 | MongoCollection::count | 锟斤拷锟斤拷锟� limit 锟斤拷 skip 锟斤拷锟斤拷锟斤拷 |
1.0.5 | MongoCollection::batchInsert | Added options parameter. |
MongoCollection::ensureIndex | Added the "name" option to override index name creation. | |
MongoCollection::insert | 锟睫改第讹拷锟斤拷锟斤拷锟斤拷为选锟斤拷锟斤拷锟介。锟斤拷 1.0.5 之前锟斤拷锟节讹拷锟斤拷锟斤拷锟斤拷锟斤拷 boolean锟斤拷指示 "safe" 选锟筋。 | |
MongoCollection::remove | 锟睫改第讹拷锟斤拷锟斤拷锟斤拷为选锟斤拷锟� array锟斤拷锟斤拷 1.0.5 之前锟斤拷锟节讹拷锟斤拷选锟斤拷锟斤拷 boolean 值锟斤拷 锟斤拷锟斤拷锟斤拷 "safe" 选锟筋。 | |
MongoCollection::save | 锟斤拷锟斤拷 options 锟斤拷锟斤拷锟斤拷 | |
MongoCollection::update | Added "safe" option. | |
1.0.2 | MongoClient::__construct | 锟睫改癸拷锟斤拷锟斤拷支锟斤拷选锟斤拷锟斤拷锟介。锟斤拷 1.0.2 之前锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟铰诧拷锟斤拷锟斤拷 server 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 connect 锟斤拷选锟斤拷 boolean 锟斤拷锟斤拷指锟斤拷锟剿癸拷锟斤拷锟斤拷锟角凤拷应锟斤拷锟节凤拷锟斤拷前锟斤拷锟接碉拷锟斤拷锟捷库。默锟斤拷为 TRUE锟斤拷 persistent 锟斤拷锟斤拷锟角凤拷应锟斤拷锟角持久的★拷 paired 锟斤拷锟斤拷锟角凤拷应锟斤拷为 paired 模式锟斤拷 |
MongoCollection::ensureIndex | Changed options parameter from boolean to array. Pre-1.0.2, the second parameter was an optional boolean value specifying a unique index. | |
1.0.1 | MongoCollection::insert | 锟斤拷锟斤拷锟斤拷锟斤拷锟� "safe" 选锟筋并锟揭诧拷锟斤拷失锟斤拷锟剿o拷锟斤拷锟斤拷锟阶筹拷 MongoCursorException锟斤拷 |
MongoCollection::update | Changed options parameter from boolean to array. Pre-1.0.1, the second parameter was an optional boolean value specifying an upsert. |