Database Reference
In-Depth Information
4.
To view list of rows in the users column family (see Figure 2-6 ), use
the following command:
select * from users;
Figure 2-6 . Map containing followers for user
5.
To add 'team_marketing' as a follower for 'ritaf' and vice
versa (see Figure 2-7 ), we can simply add it as an element in users
column family:
update users set followers = followers +
{'team_marketing':'apress marketing'} where
twitter_id='ritaf';
update users set followers = followers +
{'ritaf':'rita fernando'} where
twitter_id='apress_marketing';
Figure 2-7 . After update map of followers for each user
6.
Using update would work as an insert if row key doesn't exist in
the database. For example,
update users set followers = followers +
{'ritaf':'rita fernando'} where
twitter_id='jhassell'; // update as insert
 
 
 
 
Search WWH ::




Custom Search