Showing results for 
Search instead for 
Did you mean: 

MATCH with where clause with very long string


Hi All,

I am new to neo4j and what I am trying to do is find a device stored in a device Node with the property device_id which is a very long string. The device Id cannot be shorten.

So this is the Cypher:

  MATCH (d:Device)
  WHERE d.device_id = "W29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3RdLFtvYmplY3QgT2JqZWN0XSxbb2JqZWN0IE9iamVjdF0sW29iamVjdCBPYmplY3Rd"

 return d

But this returns the entires device node which is pretty weird. Please let me know if I am doing anything wrong here. It seems like the Id is a bit long and this might be the issue but i need this to be able to filter.

Any help will be greatfull. Chears.


Graph Fellow

Hi @nengkhoiba ,

What's the anwser you get? What's the anwer you expect? I don't see anything weird so far


Sorry for the confusion.

What my expected output is a single device node with xxxx as device_id and if the device is not found I should not be getting any results.

But what am getting as output is entire device node which I have in the db.

I hope this make sense

Graph Buddy

Apparently you want to retrieve a specific node property, but your return statement specifies the whole node. Is that right?
If so you should try return

Hi @andreperez

This part i understand fetching the particular attribute. But what happen is when I put the where clause like

WHERE device_id=xxxxxx

I am expecting the result to be only one node with the ID that i have defined but what i get is the entire nodes on the db.

Graph Fellow

Hi @nengkhoiba ,

I still don't get the issue. Can you share the result you get from this query vs the expected response?



Hi Everyone

Thank you for taking your time in my problem.

I found the solution. And it was not the query but the data in the data itself.

Nodes 2022
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.