I'm trying to figure out, how to delete all elements from the collection or drop the collection? I'm using Laravel 4.2 and "jenssegers/mongodb":"~2.0".
Could you help me with this. Thank you!
Per its docs, "This library extends the original Laravel classes, so it uses exactly the same methods", so the same way you'd do it with any of the other database drivers.
Model::truncate()
or Model::query()->delete()
would remove all items. Dropping the collection is done with the Schema class's Schema::drop('model')
.