Database Reference
In-Depth Information
Of course, the real value of indexing a node is being able to find the right node quickly
and easily. That's what we're going to look at in the next section, where you'll use the user
email index to find user nodes.
5.2. Finding the user by their email
Having a network of users is great, but now it's time to start letting users interact through
a full-blown web application that allows them to connect to friends as well as store movie
information.
In this web application, one of the first things you want to do is display a list of the users'
friends. Finding the friends of a user will involve traversing the friend relationships. But
first you need to look up the node that represents the user that has logged in.
Since your users use their email addresses as login IDs and you index user nodes by email,
it's easy to look up a user that has logged in. You can then traverse outbound friend rela-
tionships to find their friends, as figure 5.2 illustrates.
Figure 5.2. Looking up a user node from the index by using the email property
 
Search WWH ::




Custom Search