diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-10-27 12:31:48 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-10-27 12:31:48 +0200 |
| commit | 9b89717dfc286af0127108b221630f9c1d054971 (patch) | |
| tree | ea1dd3284694084e7e5f5208e04d6293c8bed36b /src-py/db_controller.py | |
| parent | 4ef04b9a1758ccd5bfc6f355a821de852efebe68 (diff) | |
DBO_rm_node_set & test
Diffstat (limited to 'src-py/db_controller.py')
| -rw-r--r-- | src-py/db_controller.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src-py/db_controller.py b/src-py/db_controller.py index 84c0743e..c73a6882 100644 --- a/src-py/db_controller.py +++ b/src-py/db_controller.py @@ -316,6 +316,25 @@ class DBO_match_link_id_set(DB_op): self.add_statement(q, q_params) +class DBO_rm_node_set(DB_op): + def __init__(self, id_set, rm_links=False): + super(DBO_rm_node_set, self).__init__() + + if rm_links: + q_arr = ['match (n)', + 'where n.id in ' + str(id_set), + 'optional match (n)-[r]-()', + 'delete n,r' + ] + else: + q_arr = ['match (n)', + 'where n.id in ' + str(id_set), + 'delete n' + ] + + q = ' '.join(q_arr) # TODO: use id param upon neo4j support: q_params = {'id_set': id_set} + self.add_statement(q) + class DB_Controller: """ neo4j DB controller |
