src/Query/Runner.php
public function insertGetId(array $values, $sequence = null)
    {
        $result = $this->collection->insertOne($values);

        if (1 == (int) $result->isAcknowledged()) {
            if (is_null($sequence)) {
                $sequence = '_id';
            }

            // Return id
            return $sequence == '_id' ? trim($result->getInsertedId()) : $values[$sequence];
        }

        return null;
    }
public function insertGetId(array $values, $sequence = null)
    {
        $result = $this->collection->insertOne($values);

        if (1 == (int) $result->isAcknowledged()) {
            if (is_null($sequence)) {
                $sequence = '_id';
            }

            // Return id
            return $sequence == '_id' ? trim($result->getInsertedId()) : $values[$sequence];
        }

        return null;
    }
public function insertGetId ( array $ values , $ sequence = null ) { $ result = $ this -> collection -> insertOne ( $ values ) ; if ( 1 == ( int ) $ result -> isAcknowledged ( ) ) { if ( is_null ( $ sequence ) ) { $ sequence = '_id' ; } // Return id return $ sequence == '_id' ? trim ( $ result -> getInsertedId ( ) ) : $ values [ $ sequence ] ; } return null ; }
Insert documet and return ID.

@param array $values
@param null $sequence
@return mixed|null
Insert documet and return ID .