self.db.set_one(self.topic, filter_q, update_dict=None,
pull={"_admin.projects_read": {"$in": session["project_id"]}})
# try to delete if there is not any more reference from projects. Ignore if it is not deleted
filter_q = {'_id': _id, '_admin.projects_read': [[], ["ANY"]]}
v = self.db.del_one(self.topic, filter_q, fail_on_empty=False)
if not v or not v["deleted"]:
self.db.set_one(self.topic, filter_q, update_dict=None,
pull={"_admin.projects_read": {"$in": session["project_id"]}})
# try to delete if there is not any more reference from projects. Ignore if it is not deleted
filter_q = {'_id': _id, '_admin.projects_read': [[], ["ANY"]]}
v = self.db.del_one(self.topic, filter_q, fail_on_empty=False)
if not v or not v["deleted"]: