开发者

Cassandra getting data (query on different attributes)

开发者 https://www.devze.com 2023-01-05 22:42 出处:网络
how i can get data from Cassandra using value posts = { \'1\': {//this post id \'user_id\': \'4\', \'body\': \'This is awesome!\',

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开发者_如何学Python certain user

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

regrads


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

userIds = {

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

}
0

精彩评论

暂无评论...
验证码 换一张
取 消