FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mage/cpp/node_module/node_module.cpp at main · memgraph/mage · GitHub
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
memgraph
/
mage
Public archive
Notifications
You must be signed in to change notification settings
Fork
35
Star
331
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
mage
/
cpp
/
node_module
/
node_module.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (36 loc) · 2.17 KB
Breadcrumbs
mage
/
cpp
/
node_module
/
node_module.cpp
Copy path
File metadata and controls
45 lines (36 loc) · 2.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
include
<
mgp.hpp
>
#
include
"
algorithm/node.hpp
"
extern
"
C
"
int
mgp_init_module
(
struct
mgp_module
*
module
,
struct
mgp_memory
*memory) {
try
{
mgp::MemoryDispatcherGuard guard{memory};
AddProcedure
(Node::RelationshipsExist,
std::string
(Node::
kProcedureRelationshipsExist
).
c_str
(),
mgp::ProcedureType::Read,
{
mgp::Parameter
(
std::string
(Node::
kArgumentNodesRelationshipsExist
).
c_str
(), mgp::Type::Node),
mgp::Parameter
(
std::string
(Node::
kArgumentRelationshipsRelationshipsExist
).
c_str
(),
{mgp::Type::List, mgp::Type::String})},
{
mgp::Return
(
std::string
(Node::
kReturnRelationshipsExist
).
c_str
(), {mgp::Type::Map, mgp::Type::Any})},
module
, memory);
AddProcedure
(
Node::RelationshipExists, Node::
kProcedureRelationshipExists
, mgp::ProcedureType::Read,
{
mgp::Parameter
(Node::
kArgumentsNode
, mgp::Type::Node),
mgp::Parameter
(Node::
kArgumentsPattern
, {mgp::Type::List, mgp::Type::String},
mgp::Value
(mgp::List{}))},
{
mgp::Return
(Node::
kReturnRelationshipExists
, mgp::Type::Bool)},
module
, memory);
AddProcedure
(
Node::RelationshipTypes, Node::
kProcedureRelationshipTypes
, mgp::ProcedureType::Read,
{
mgp::Parameter
(Node::
kRelationshipTypesArg1
, mgp::Type::Node),
mgp::Parameter
(Node::
kRelationshipTypesArg2
, {mgp::Type::List, mgp::Type::String},
mgp::Value
(mgp::List{}))},
{
mgp::Return
(Node::
kResultRelationshipTypes
, {mgp::Type::List, mgp::Type::String})},
module
, memory);
mgp::AddFunction
(Node::DegreeIn, Node::
kFunctionDegreeIn
,
{
mgp::Parameter
(Node::
kDegreeInArg1
, mgp::Type::Node),
mgp::Parameter
(Node::
kDegreeInArg2
, mgp::Type::String,
"
"
)},
module
, memory);
mgp::AddFunction
(Node::DegreeOut, Node::
kFunctionDegreeOut
,
{
mgp::Parameter
(Node::
kDegreeOutArg1
, mgp::Type::Node),
mgp::Parameter
(Node::
kDegreeOutArg2
, mgp::Type::String,
"
"
)},
module
, memory);
}
catch
(
const
std::exception &e) {
return
1
;
}
return
0
;
}
extern
"
C
"
int
mgp_shutdown_module
() {
return
0
; }
Back
|
FazBrowse Home
|
New Git URL