truncate method

Future<void> truncate(
  1. {bool excludeSystem = true}
)

Implementation

Future<void> truncate({bool excludeSystem = true}) async {
  final collections = await listCollections(excludeSystem: excludeSystem);
  final futures = collections.map((coll) {
    return _connection.request(
      method: 'PUT',
      path: '/_api/collection/${coll['name']}/truncate',
    );
  });
  return Future.wait(futures);
}