I have a problem in spring boot, and it is that I have the logs full of these messages:
The query used a deprecated function: id.
2023-09-06T15:45:20.817+02:00 WARN 466208 --- [o-auto-1-exec-3] org.springframework.data.neo4j.cypher : Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
for all my queries and I don't know what to do because it even comes out for this query:
@Query("""
match (p:Post) - [:PUBLISHED_BY] -> (u:UserApp {id : $user_id})
return p
""")
List<Post> findAllByUserId(String user_id);
I wonder if it thinks you are using id(node) instead of it being a variable name. Have you tried to change it from id to something else (e.g., userID) to see if you get the same behavior?
There is a previous post where we were told to create the following bean and it would suppress the warning. It worked for me with springboot 3.1.1, but reappeared when I tried 3.1.2.
I have the same issue using 3.2.2 (and spring-data-neo4j 7.2.2):
2024-02-15T12:20:32.238-08:00 WARN 37512 --- [o4jDriverIO-3-5] o.s.data.neo4j.cypher.deprecation : Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
MATCH (startNode:`Node`)-[rel:`LINKS`]->(:`Node`) WHERE (startNode.uuid = $fromId AND NOT (id(rel) IN $__knownRelationShipIds__)) DELETE rel
^
The query used a deprecated function: `id`.
2024-02-15T12:20:32.262-08:00 WARN 37512 --- [o4jDriverIO-3-5] o.s.data.neo4j.cypher.deprecation : Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
MATCH (startNode:`Node`) WHERE startNode.uuid = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId CREATE (startNode)-[relProps:`LINKS`]->(endNode) SET relProps += $__properties__ RETURN id(relProps) AS __internalNeo4jId__, elementId(relProps) AS __elementId__
^
The query used a deprecated function: `id`.
2024-02-15T12:20:32.268-08:00 WARN 37512 --- [o4jDriverIO-3-5] o.s.data.neo4j.cypher.deprecation : Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
MATCH (startNode:`Node`)-[rel:`LINKS`]->(:`Node`) WHERE (startNode.uuid = $fromId AND NOT (id(rel) IN $__knownRelationShipIds__)) DELETE rel
^
The query used a deprecated function: `id`.
2024-02-15T12:20:32.279-08:00 WARN 37512 --- [o4jDriverIO-3-5] o.s.data.neo4j.cypher.deprecation : Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
MATCH (startNode:`Node`) WHERE startNode.uuid = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId CREATE (startNode)-[relProps:`LINKS`]->(endNode) SET relProps += $__properties__ RETURN id(relProps) AS __internalNeo4jId__, elementId(relProps) AS __elementId__
...
I do have this bean configured, which I believe is being observed because I receive a duplication error if I define the same bean in another place (crude gut check):
In my previous post I stated version 3.1.1 resolved the issue (with the bean definition), but it reappeared when I upgraded to 3.1.2. I just tried 3.1.3 and it appears.
I also just tried 3.2.1 and 3.2.2. The warnings were not generated with both versions. I see the version of SDN brought in from spring-boot-starter-data-neo4j:3.2.2 is spring-data-neo4j:7.2.2, so mine looks the same as yours. My Configuration bean is also created the same as what you have posted.
I am sure you are doing it, but is the bean defined in a spring component?
Well, you have the configuration class correctly annotated. The other thing to ensure is that the configuration class is within the auto component scan directories or specified as a configuration class. Considering your other bean in the class is working, you can assume one of those is true.
I autowired the bean in my controller class and set a break point so I could view the instance of the cypher dsl configuration class. Below is a screenshot. As shown, the dialect set to NEO4J_5.
I have kind of a similar issue.
I was following the official tutorial, to connect from python to Neo4J. Using Neo4j from Python - Getting Started . When I do the call to the class and its method I get the following:
Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.FeatureDeprecationWarning} {category: DEPRECATION} {title: This feature is deprecated and will be removed in future versions.} {description: The query used a deprecated function: `id`.} {position: line: 1, column: 82, offset: 81} for query: "CREATE (a:Greeting) SET a.message = $message RETURN a.message + ', from node ' + id(a)"
hello, world, from node 0
I think is a related issue. If not, please let me know and I will open another ticket. I am using Neo4J 5.24.2 in Ubuntu 22.04.5 LTS