Add implementation of C++ API Node::RemoveProperty (#1128)

This commit is contained in:
Matija Pintarić
2023-08-01 20:11:38 +02:00
committed by GitHub
parent 2877c343e8
commit 514fed51c4
2 changed files with 18 additions and 0 deletions

View File

@@ -637,6 +637,9 @@ class Node {
/// @brief Sets the chosen property to the given value.
void SetProperty(std::string property, Value value);
/// @brief Removes the chosen property.
void RemoveProperty(std::string property);
/// @brief Retrieves the value of the chosen property.
Value GetProperty(const std::string &property) const;
@@ -2574,6 +2577,8 @@ inline void Node::SetProperty(std::string property, Value value) {
mgp::vertex_set_property(ptr_, property.data(), value.ptr());
}
inline void Node::RemoveProperty(std::string property) { SetProperty(property, Value()); }
inline Value Node::GetProperty(const std::string &property) const {
mgp_value *vertex_prop = mgp::vertex_get_property(ptr_, property.data(), memory);
return Value(steal, vertex_prop);