How to delete all documents in a collection?

How to delete all documents in a collection?

And is this explained in the documentation somewhere?

Thanks.

@Melody, welcome to the Fauna Community.
There are couple of ways to delete a collection.

  1. Delete the collection. More Info

  2. Read through Collection and Delete each document like shown below. Few things to be pointed.

    • Collection level Index (with no terms) exists.
    • Default Paginate size is 64. You will have to adjust the size (max: 100000) depending on the number of documents in the Collection.
    • Each Delete results in one Write Ops.
Map(
  Paginate(
    Match(Index("all_users"))
  ),
  Lambda("X", Delete(Var("X")))
)