diff --git a/arango_admin.py b/arango_admin.py new file mode 100644 index 0000000..f2064d3 --- /dev/null +++ b/arango_admin.py @@ -0,0 +1,30 @@ +from _arango import arango + +def truncate(): + arango.db.collection("other_persons").truncate() + arango.db.collection("all_relations").truncate() + + +def clear_info_persons(): + persons = list(arango.db.collection("persons").all()) + for person in persons: + person['info'] = [] + person['mentioned_in_interrogation'] = [] + arango.db.collection('persons').update(person, merge=False) + +clear_info_persons() + +# persons = list(arango.db.collection("persons").all()) + +# for person in persons: +# for interrogation in person['interrogations']: + +# arango.db.collection('interrogations').update({'_key': interrogation, 'person_id': person['_id']}, ) +# print(f"Updated {interrogation} with person_id {person['_id']}") + + +# interrogations = list(arango.db.collection("interrogations").all()) + +# for interrogation in interrogations: +# interrogation['person_id'] = 'persons/' + interrogation['person'].replace('persons_', '') +# arango.db.collection('interrogations').update(interrogation, merge=False) \ No newline at end of file