diff --git a/include/query_engine/hardcode/queries.hpp b/include/query_engine/hardcode/queries.hpp index 11b7bfa5a..8d1a0c86b 100644 --- a/include/query_engine/hardcode/queries.hpp +++ b/include/query_engine/hardcode/queries.hpp @@ -221,7 +221,7 @@ auto load_queries(Db &db) return t.commit(); }; - // MATCH ()-[r]-() WHERE ID(r) = 0 DELETE r + // MATCH ()-[r]-() WHERE ID(r) = id DELETE r auto match_edge_id_delete = [&db](const properties_t &args) { DbAccessor t(db); @@ -262,11 +262,17 @@ auto load_queries(Db &db) return t.commit(); }; - // MATCH ()-[r]-() WHERE ID(r) = 0 DELETE r - auto = [&db](const properties_t &args) { + // MATCH (n)-[:TYPE]->(m) WHERE ID(n) = id RETURN m + auto match_type_id_return = [&db](const properties_t &args) { DbAccessor t(db); - return t.commit(); + auto ov = t.vertex_find(args[0]->as().value); + if (!option_fill(ov)) return t.commit(), false; + auto v = ov.take(); + + auto resoults = iter::make_f` + + return t.commit(); }; // Blueprint: diff --git a/include/utils/iterator/filter.hpp b/include/utils/iterator/filter.hpp index ddbc45700..fc908f19c 100644 --- a/include/utils/iterator/filter.hpp +++ b/include/utils/iterator/filter.hpp @@ -6,26 +6,28 @@ namespace iter { -// Class which maps values returned by I iterator into value of type T with OP +// Class which filters values returned by I iterator into value of type T with +// OP // function. // T - type of return value // I - iterator type // OP - type of mapper function template -class Map : public IteratorBase +class Filter : public IteratorBase { public: - Map() = delete; + Filter() = delete; - // Map operation is designed to be used in chained calls which operate on a - // iterator. Map will in that usecase receive other iterator by value and + // Filter operation is designed to be used in chained calls which operate on + // a + // iterator. Filter will in that usecase receive other iterator by value and // std::move is a optimization for it. - Map(I &&iter, OP &&op) : iter(std::move(iter)), op(std::move(op)) {} + Filter(I &&iter, OP &&op) : iter(std::move(iter)), op(std::move(op)) {} - Map(Map &&m) : iter(std::move(m.iter)), op(std::move(m.op)) {} + Filter(Filter &&m) : iter(std::move(m.iter)), op(std::move(m.op)) {} - ~Map() final {} + ~Filter() final {} Option next() final { @@ -46,7 +48,7 @@ template auto make_map(I &&iter, OP &&op) { // Compiler cant deduce type T. decltype is here to help with it. - return Map(std::move(iter), - std::move(op)); + return Filter(std::move(iter), + std::move(op)); } }