Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:56:55+00:00 2026-05-24T19:56:55+00:00

Anybody know which is the easy way to insert a json string in cassandra.

  • 0

Anybody know which is the easy way to insert a json string in cassandra.
Suppose I have a json string like this: {‘key1′:’val1′,’key2′:’val2’}

In MongoDB we can insert directly a json string like dbobj.insert(jsonstring);
So is there any way to do like this in Cassandra?(I am coding in java)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:56:57+00:00Added an answer on May 24, 2026 at 7:56 pm

    There are at least 3 ways, but it depends what you are trying to achieve and what kinds of query you want to run.

    You could store the JSON string as just a plain string/byte, as a Cassandra column name (assuming there is something you can use as the row key). You won’t be able to do queries based on the JSON content, though; this would be opaque data that you process client-side.

    You could split up the JSON before storage, so that key1, key2 are column names and val1, val2 are the corresponding column values. Again, you’d need something to use as a row key. This method would let you retrieve individual values, and use secondary indexes to retrieve rows with particular values.

    You could even use key1, key2 as row keys, with val1, val2 as column names. Given that you have the key-val pairs grouped in JSON, they presumably belong to the same entity and are related, so this is unlikely to be useful, but I mention it for completeness.

    Edited to add: If your question is actually how to insert data into Cassandra at all, then you should read the docs for a Java client such as Hector (there are other options too – see http://wiki.apache.org/cassandra/ClientOptions)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know which JSF version is most suitable to use when deploying to
Does anybody know if Microsoft has already decided which version of the .NET framework
Can anybody help me out to know the possible reasons for which Apple store
Anybody know of a way to copy a file from path A to path
Anybody know what my DLLImport statement should look like here: extern C __declspec(dllexport) long
Anybody know how to get gmail's OpenID working? All I find is this http://openid-provider.appspot.com/
Does anybody know of a way to list up the loaded plugins in Vim
Does anybody know any good resources for learning how to program CIL with in-depth
Does anybody know a technique to discover memory leaks caused by smart pointers? I
Does anybody know of any sample databases I could download, preferably in CSV or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.