createCollection method

Future<CollectionPropertiesResponse> createCollection({
  1. required String name,
  2. bool waitForSync = false,
  3. CollectionType collectionType = CollectionType.document,
})

Implementation

Future<CollectionPropertiesResponse> createCollection({
  required String name,
  bool waitForSync = false,
  CollectionType collectionType = CollectionType.document,
}) async {
  final answer = await _httpPost([
    '_db',
    db,
    '_api',
    'collection'
  ], {
    'name': name,
    'waitForSync': waitForSync,
    'type': _typeFromCollectionType(collectionType),
  });
  final ret = _toCollectionPropertiesResult(answer);
  return ret;
}