C
C#5mo ago
TheGoose

✅ How do i convert .json to .db for LiteDB?

i jave a json files and i want to convert them to one .db file. whats the best way to do it?
13 Replies
Jimmacle
Jimmacle5mo ago
those are entirely different/incompatible formats so you'll need to write a program that reads in the json and writes out a db file
TheGoose
TheGoose5mo ago
yeah, thats what i meant. i would easily do it, but json has places like this and i dont know how to get them
No description
Jimmacle
Jimmacle5mo ago
what do you mean by get? what place?
TheGoose
TheGoose5mo ago
place that has several values (label and scaling) i cant just create a class for them, cause they are different. in some places its 1, 5, 11, 17, in some - 3, 6, 9 and other variations
Jimmacle
Jimmacle5mo ago
the "scaling" object maps to a Dictionary<string, string>
Angius
Angius5mo ago
$jsongen
MODiX
MODiX5mo ago
Use https://app.quicktype.io or https://json2csharp.com to generate classes from your JSON
Instantly parse JSON in any language | quicktype
Whether you're using C#, Swift, TypeScript, Go, C++ or other languages, quicktype generates models and helper code for quickly and safely reading JSON in your apps. Customize online with advanced options, or download a command-line tool.
Convert JSON to C# Classes Online - Json2CSharp Toolkit
Convert any JSON object to C# classes online. Json2CSharp is a free toolkit that will help you generate C# classes on the fly.
TheGoose
TheGoose5mo ago
omg thank you, whank you so much
Angius
Angius5mo ago
In VS you can also do edit -> paste special -> json as classes Rider has something similar as well
TheGoose
TheGoose5mo ago
can you help me with this?.. it just wont work
No description
Jimmacle
Jimmacle5mo ago
can you not model your entire document as a class? you shouldn't be doing manual things with jarray/etc
TheGoose
TheGoose5mo ago
i just found some guide, i dunno.. i need to convert the whole json to a list, so i can do something with it
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View