Groups
Groups
Sign in
Groups
Groups
Neo4j
Conversations
About
Send feedback
Help
Check if item exists in index
85 views
Skip to first unread message
Samwillie
unread,
May 11, 2012, 6:26:50 AM
5/11/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Neo4j
Hi,
Is there a way to check if for example an id exists in index - just to
avoid a null pointer exception like in the statement below?
IndexHits<Node> nodeHits = index.get("id", nodeId);
//The above statement throws a null pointer exception if the nodeId
doesn't exist in index.
Node node = nodeHits.getSingle();
nodeHits.close();
Thanks,
Samwillie
unread,
May 11, 2012, 7:37:36 AM
5/11/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Neo4j
Hi,
Sorry for the post, found the "index.existsForNodes()" method using
which we can avoid a null pointer exception.
Thanks again,
Peter Neubauer
unread,
May 11, 2012, 7:38:15 AM
5/11/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
Ok,
was just on my way to answer :)
Cheers,
/peter neubauer
G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L:
http://www.linkedin.com/in/neubauer
T: @peterneubauer
If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j
Samwillie
unread,
May 11, 2012, 8:32:17 AM
5/11/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Neo4j
Thanks Peter!
On May 11, 1:38 pm, Peter Neubauer <
peter.neuba...@neotechnology.com
>
wrote:
Reply all
Reply to author
Forward
0 new messages