Search code examples
faunadb

Remove collection through API in Fauna


Header says it all. Is there a way to delete/remove/drop a collection in FaunaDB through the API?

I've tried to look through all of the listed functions but I hope I've missed it.


Solution

  • Sure. Delete($ref) where $ref is something like Collection("foo") will delete all the documents in the named collection.

    Full docs for Delete are here.

    There is also an example provided, as eskwayrd points out.