|
MongoCollection::batchInsert(PECL mongo >=0.9.0) MongoCollection::batchInsert — Inserts multiple documents into this collection ОписаниеСписок параметров
Возвращаемые значенияIf "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occured ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise. ОшибкиThrows MongoCursorException if the "safe" option is set and the insert fails. Throws MongoCursorTimeoutException if the "safe" option is set to a value greater than one and the database cannot replicate the operation in MongoCollection::$wtimeout milliseconds. Список изменений
ПримерыПример #1 MongoCollection::batchInsert() example Batch insertion is a quick way to add many elements to the database at once
<?php Результатом выполнения данного примера будет что-то подобное: 4bf43ac68ead0e1971000000 4bf43ac68ead0e1971010000 4bf43ac68ead0e1971020000 ... string(5) "user1" string(5) "user2" string(5) "user3" ... Смотрите также
|
|||||||