Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-01-2021 11:53 AM
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.
09-01-2021 12:24 PM
Hi @nengkhoiba ,
What's the anwser you get? What's the anwer you expect? I don't see anything weird so far
Bennu
09-01-2021 10:23 PM
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
09-01-2021 02:25 PM
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 d.property-you-re-looking-for
09-01-2021 10:28 PM
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.
09-02-2021 01:08 AM
Hi @nengkhoiba ,
I still don't get the issue. Can you share the result you get from this query vs the expected response?
Bennu
09-04-2021 07:56 AM
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.
All the sessions of the conference are now available online