Phalcon\Db\Adapter\MongoDB\Collection::insertMany PHP Method

insertMany() public method

Inserts multiple documents.
See also: InsertMany::__construct() for supported options
See also: http://docs.mongodb.org/manual/reference/command/insert/
public insertMany ( array $documents, array $options = [] ) : InsertManyResult
$documents array The documents to insert
$options array Command options
return InsertManyResult
    public function insertMany(array $documents, array $options = [])
    {
        if (!isset($options['writeConcern'])) {
            $options['writeConcern'] = $this->writeConcern;
        }
        $operation = new InsertMany($this->databaseName, $this->collectionName, $documents, $options);
        $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
        return $operation->execute($server);
    }