you want to use a collection that hold the product name for various products. if you want to query that will find order of sequence in which product is ordered --which type of collection you would use
- MAP
- SET
- LIST
you want to use a collection that hold the product name for various products. if you want to query that will find order of sequence in which product is ordered --which type of collection you would use
You can use SET because the values of a set are stored unordered, but will return the elements in sorted order when queried.
https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useSet.html
@biswa333_125242 I could not understand your requirements clearly. The various collection choices and their uses are as listed below.
You can review your requirements and map the right collection type to use. Or please feel free to update the question with more details and we can provide further details.
Hi @biswa333_125242:
As suggested by other please be more specific to your requirement.
As far as I understood, you want to store orders placed against some key and like to keep the track of orders by date placed, also the product could be ordered multiple times. If so then using List could be a good choice to maintain natural creation date order. Cheers!!
7 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use