我期待着与Cassandra使用Cassandra驱动程序在nodejs。
当我执行这样一个简单的查询时:
const results = await chatDbClient.execute('SELECT * FROM chat_db.messages LIMIT 5');
return results.rows;
我收到以下结果:
Row from Keyspaces Row {
user_from: [Long],
user_to: [Long],
message_id: [TimeUuid],
body: 'c'
}
[
Row {
user_from: Long { low: 1, high: 0, unsigned: false },
user_to: Long { low: 2, high: 0, unsigned: false },
message_id: TimeUuid {
buffer: <Buffer f0 c2 49 b1 fd a4 11 ea 8b 02 85 9f 38 c2 63 74>
},
body: 'c'
},
Row {
user_from: Long { low: 1, high: 0, unsigned: false },
user_to: Long { low: 2, high: 0, unsigned: false },
message_id: TimeUuid {
buffer: <Buffer f0 c2 22 a3 fd a4 11 ea bc 5e cb 7d 37 47 a0 82>
},
body: 'f'
},
Row {
user_from: Long { low: 1, high: 0, unsigned: false },
user_to: Long { low: 2, high: 0, unsigned: false },
message_id: TimeUuid {
buffer: <Buffer f0 c2 22 a2 fd a4 11 ea bc 5e cb 7d 37 47 a0 82>
},
body: 'e'
},
Row {
user_from: Long { low: 1, high: 0, unsigned: false },
user_to: Long { low: 2, high: 0, unsigned: false },
message_id: TimeUuid {
buffer: <Buffer f0 c1 fb 95 fd a4 11 ea a3 0f 3b e9 2e a5 73 87>
},
body: 'd'
},
Row {
user_from: Long { low: 1, high: 0, unsigned: false },
user_to: Long { low: 2, high: 0, unsigned: false },
message_id: TimeUuid {
buffer: <Buffer f0 c1 fb 94 fd a4 11 ea a3 0f 3b e9 2e a5 73 87>
},
body: 'm'
}
]
但如果我直接从aws Jmeter 板执行查询以进行测试,我会收到以下信息:
为什么在我的应用程序中,结果的格式如此奇怪?
提前tnx
2条答案
按热度按时间aurhwmvo1#
问题解决了,读取数据就足够用了:tostring()
results.rows[i].user_to.toString()
olqngx592#
在应用程序中尝试以下操作