Skip to content

Commit

Permalink
Merge pull request #1765 from blacklanternsecurity/update-neo4j
Browse files Browse the repository at this point in the history
Fix Neo4j deprecation warning
  • Loading branch information
TheTechromancer authored Sep 12, 2024
2 parents 3df0cde + b9b57d0 commit 47c338a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bbot/modules/output/neo4j.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import json
import logging
from contextlib import suppress
from neo4j import AsyncGraphDatabase

from bbot.modules.output.base import BaseOutputModule


# silence annoying neo4j logger
logging.getLogger("neo4j").setLevel(logging.CRITICAL)


class neo4j(BaseOutputModule):
"""
# start Neo4j in the background with docker
Expand Down Expand Up @@ -110,7 +115,7 @@ async def merge_events(self, events, event_type, id_only=False):

cypher = f"""UNWIND $events AS event
MERGE (_:{event_type} {{ id: event.id }})
SET _ += event
SET _ += properties(event)
RETURN event.data as event_data, event.id as event_id, elementId(_) as neo4j_id"""
neo4j_ids = {}
# insert events
Expand Down

0 comments on commit 47c338a

Please sign in to comment.