Hacker News new | ask | show | jobs
by nh2 2850 days ago
Can you elaborate why that is? Of all types I could come up with (beyond bool), integers and unsigned integers seem the most basic.
1 comments

The simplest explanation is that ArangoDB uses JSON as dataformat to the outside world. JSON doesn't support these types like arbitrary exact decimal, or timestamps. Despite ArangoDB using VelocyPack internally, which is capabable of much more than JSON, a user will import JSON and get JSON back.

You can of course use datetime https://docs.arangodb.com/3.3/AQL/Functions/Date.html and decimals with a precision of 10E38 in ArangoDB but it is not as precise as in a relational database. If we want to be as precise as a relational DB, then we would have to say goodbye to JSON

MongoDB uses this to express decimals as JSON: { "$numberDecimal": "<number>" }
I suspect creating a specification based on what mongodb does/did might be the better approach - but a quick search for "typed json" turned up:

https://www.tjson.org/

Not sure if I'm a fan of the syntax - but some kind of open, sane, standard would be nice.