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

insertOne() public method

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