velocypack
velocypack copied to clipboard
Add to-JSON-dumping for non-JSON data types
Data types that have no equivalent in JSON should be convertible to JSON using a configurable mechanism. The obvious conversions mechanisms that we should provide by default are:
- conversion of non-JSON data types to
null - throwing an exception if an incompatible data type is encountered
- custom conversion:
- binary to base64 or something similar
- UTCDate to integer
All of this should be configurable via options for the Dumper.
date.toISOString() can also be desired for date objects. References and especially circular dependencies are probably best dealt with by substitution with null, although some special syntax could be introduced to later recover the inter references.