Compare commits

...

1 Commits

Author SHA1 Message Date
Marko Budiselic
bc5237a4fd Add mgp_mock_example.py 2024-01-25 10:36:00 -07:00

View File

@@ -0,0 +1,17 @@
# https://memgraph.com/docs/custom-query-modules/python
# changes_logger.py OR can be directly pasted into the Lab
import mgp_mock as mgp
@mgp.read_proc
def log(
context: mgp.ProcCtx,
data: mgp.Nullable[mgp.Any]
) -> mgp.Record(done=bool):
# https://memgraph.com/docs/custom-query-modules/python/python-api#logger-objects
logger = mgp.Logger()
for changes in data:
for item in changes:
logger.info(str(item))
return mgp.Record(done=True)
log(mgp.ProcCtx, ["bla"])