简体   繁体   English

在Scala中将CassandraRow转换为JSON形式的字符串

[英]Convert CassandraRow to JSON form string in scala

I have this string:我有这个字符串:

CassandraRow{
    email: test@example.com,
    lastname: Example,
    name: User,
    password: Password}

How can I convert the above string in the form of JSON string of type?如何将上述字符串转换为 JSON 字符串类型的形式?

{"email": "test@example.com",
 "lastname": "Example",
 "name": "User",
 "password": "Password"}

使用 dataAsString 方法提取 CassandraRow 中的任何内容,然后处理它就容易多了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM