pygsti.io.mongodb.remove_auxtree_from_mongodb

pygsti.io.mongodb.remove_auxtree_from_mongodb#

remove_auxtree_from_mongodb(mongodb, collection_name, doc_id, auxfile_types_member='auxfile_types', session=None, recursive=None)#

Remove some or all of the MongoDB documents written by write_auxtree_to_mongodb

Removes a root document and possibly auxiliary documents.

Parameters:
  • mongodb (pymongo.database.Database) – The MongoDB instance to remove documents from.

  • collection_name (str) – the MongoDB collection within mongodb to remove document from.

  • doc_id (bson.objectid.ObjectId) – The identifier of the root document stored in the database.

  • auxfile_types_member (str, optional) – The key of the stored document used to describe how other members are serialized into separate “auxiliary” documents. Unless you know what you’re doing, leave this as the default.

  • session (pymongo.client_session.ClientSession, optional) – MongoDB session object to use when interacting with the MongoDB database. This can be used to implement transactions among other things.

  • recursive (RecursiveRemovalSpecification, optional) – An object that filters the type of documents that are removed. Used when working with inter-related experiment designs, data, and results objects to only remove the types of documents you know aren’t being shared with other documents.

Returns:

The result of deleting (or attempting to delete) the root record

Return type:

pymongo.results.DeleteResult