views:

46

answers:

1

dear how i can get data from Cassandra using value

posts = {

    '1': {   //this post id 
        'user_id': '4',
        'body': 'This is awesome!',
    },

}

i cen get the post using post id can i get posts related to certain user

i mean get post related to user_id=4 like an example (query using user_id attribute)

regrads

+3  A: 

For that you will need to maintain your own (secondary) index. e.g

userIds = {

    '4': {   //this user id
        'post_id': '1'
    },

}
Schildmeijer
you mean that i need to create antoher column family contain (usersid-postid)
islam
yes, create a new cf
Schildmeijer