'Removes document from Mongo
The input is a python dictionary that represents a mongo document.
The documents has ns and _ts fields.'

@wrap_exceptions
def remove(self, document_id, namespace, timestamp):

    (database, coll) = self._db_and_collection(namespace)
    meta_collection = self._get_meta_collection(namespace)
    doc2 = self.meta_database[meta_collection].find_one_and_delete({self.id_field: document_id})
    if (doc2 and doc2.get('gridfs_id')):
        GridFS(self.mongo[database], coll).delete(doc2['gridfs_id'])
    else:
        self.mongo[database][coll].delete_one({'_id': document_id})
