-
Notifications
You must be signed in to change notification settings - Fork 186
Collection columns
Flavian Alexandru edited this page May 29, 2015
·
8 revisions
Cassandra collections do not allow custom data types. Storing JSON as a string is possible, but it's still a text
column as far as Cassandra is concerned.
The type
in the below example is always a default C* type.
JSON columns require you to define a toJson
and fromJson
method, telling phantom how to go from a String
to the type you need.
It makes no assumptions as to what library you are using, although we have tested with lift-json
and play-json
.
Examples on how to use JSON columns can be found in JsonColumnTest.scala
phantom columns | Cassandra columns |
---|---|
ListColumn.<type> | list<type> |
SetColumn.<type> | set<type> |
MapColumn.<type, type> | map<type, type> |
JsonColumn.<type> | text |
JsonListColumn.<type> | list<text> |
JsonSetColumn.<type> | set<type> |
To stay up-to-date with our latest releases and news, follow us on Twitter: @outworkers.
- Issues and questions
- Adopters
- Roadmap
- Changelog
- Tutorials
- Commercial support
- Using phantom in your project
- Primitive columns
- Optional primitive columns
- Collection columns
- Collection operators
- Automated schema generation
- Indexing columns
- Data modeling with phantom
- Querying with phantom
- Asynchronous iterators
- Batch statements
- Apache Thrift integration
- Apache ZooKeeper integration
- The phantom testkit