-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storing multiple types inside map #831
Comments
What does your JSON look like, and how are you printing |
I'm putting it into the out stream My JSON:
|
It's most assuredly because your map contains If you want to store the primitive types in the map, you need to use a variant, or another struct that you create yourself that can store |
Good point.
How do I manage to do that? What do you mean by extracting? |
Just like you did before:
|
Fine. There are two methods so far for extracting values:
Am I right? I will post a solution here in case anyone would search for something like this. |
Yes, you can do |
Any news on this @pompex ? |
Oh yes, I just had to extract the values to wanted data type. Thats because objects stored in the map been still json objects. So instead of |
Thanks for reporting! |
Hello. Recently I have discovered this library and decided to give it a try. It looks really promising.
I have faced my first issue however. While performing JSON file loading I would like to parse and store some values by id in a map.
Like this:
Basically it's working. However, when I'm printing
test[MESSAGE]
I get the message being quoted: "My Message". Similar issue for integers, which are not even integers (need to cast them in order).How can I properly parse and store my data and then retrieve it with correct data type?
The text was updated successfully, but these errors were encountered: