Commit d622b2cd authored by Jens Segers's avatar Jens Segers

Adding truncate

parent d9bee097
...@@ -23,6 +23,7 @@ class Query extends \Illuminate\Database\Query\Builder { ...@@ -23,6 +23,7 @@ class Query extends \Illuminate\Database\Query\Builder {
'<=' => '$lte', '<=' => '$lte',
'>' => '$gt', '>' => '$gt',
'>=' => '$gte', '>=' => '$gte',
'exists' => '$exists',
); );
/** /**
...@@ -259,6 +260,17 @@ class Query extends \Illuminate\Database\Query\Builder { ...@@ -259,6 +260,17 @@ class Query extends \Illuminate\Database\Query\Builder {
return $this; return $this;
} }
/**
* Run a truncate statement on the table.
*
* @return void
*/
public function truncate()
{
$result = $this->collection->drop();
return ((int) $result['ok']) == 1;
}
/** /**
* Compile the where array * Compile the where array
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment