@@ -206,6 +206,11 @@ def create_collection(self,
206206 index_bucket_count = None ):
207207 """Create a new collection.
208208
209+ .. note::
210+
211+ Starting from ArangoDB version 3.1+, system collections must have
212+ a name with a leading underscore ``_`` character.
213+
209214 :param name: the name of the collection
210215 :type name: str | unicode
211216 :param sync: wait for the operation to sync to disk
@@ -275,19 +280,27 @@ def create_collection(self,
275280 raise CollectionCreateError (res )
276281 return self .collection (name )
277282
278- def delete_collection (self , name , ignore_missing = False ):
283+ def delete_collection (self , name , ignore_missing = False , system = None ):
279284 """Delete a collection.
280285
281286 :param name: the name of the collection to delete
282287 :type name: str | unicode
283288 :param ignore_missing: do not raise if the collection is missing
284289 :type ignore_missing: bool
290+ :param system: whether the collection is a system collection (this
291+ option is only available with ArangoDB 3.1+, lower versions do
292+ distinguish between system or non-system collections)
293+ :type system: bool
285294 :returns: whether the deletion was successful
286295 :rtype: bool
287296 :raises arango.exceptions.CollectionDeleteError: if the collection
288297 cannot be deleted from the database
289298 """
290- res = self ._conn .delete ('/_api/collection/{}' .format (name ))
299+ res = self ._conn .delete (
300+ '/_api/collection/{}' .format (name ),
301+ params = {'isSystem' : system }
302+ if system is not None else None # pragma: no cover
303+ )
291304 if res .status_code not in HTTP_OK :
292305 if not (res .status_code == 404 and ignore_missing ):
293306 raise CollectionDeleteError (res )
0 commit comments