public function haveInCollection($collection, array $data)
    {
        $collection = $this->driver->getDbh()->selectCollection($collection);
        if ($this->driver->isLegacy()) {
            $collection->insert($data);
            return $data['_id'];
        }

        $response = $collection->insertOne($data);
        return (string) $response->getInsertedId();
    }
public function haveInCollection($collection, array $data)
    {
        $collection = $this->driver->getDbh()->selectCollection($collection);
        if ($this->driver->isLegacy()) {
            $collection->insert($data);
            return $data['_id'];
        }

        $response = $collection->insertOne($data);
        return (string) $response->getInsertedId();
    }
public function haveInCollection ( $ collection , array $ data ) { $ collection = $ this -> driver -> getDbh ( ) -> selectCollection ( $ collection ) ; if ( $ this -> driver -> isLegacy ( ) ) { $ collection -> insert ( $ data ) ; return $ data [ '_id' ] ; } $ response = $ collection -> insertOne ( $ data ) ; return ( string ) $ response -> getInsertedId ( ) ; }
Inserts data into collection

``` php
<?php
$I->haveInCollection('users', array('name' => 'John', 'email' => 'john@coltrane.com'));
$user_id = $I->haveInCollection('users', array('email' => 'john@coltrane.com'));
```

@param $collection
@param array $data
Inserts data into collection