Opened 8 years ago
Closed 8 years ago
#1323 closed defect (fixed)
json format encode
Reported by: | Dimitar Misev | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 9.3 |
Component: | conversion | Version: | development |
Keywords: | Cc: | Peter Baumann, Alex Dumitru, Vlad Merticariu | |
Complexity: | Medium |
Description
3D csv encode example:
RASQL="rasql --user rasadmin --passwd rasadmin" $RASQL -q "create collection test_csv UShortSet3" $RASQL -q "insert into test_csv values marray i in [0:1,0:2,0:3] values 1us" $RASQL -q "select csv(c) from test_csv as c" --out string --quiet { {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }, { {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }
A json alternative encoding should be straightforward with just substituting '{' and '}' with '[' and ']', and adding an outer brackets pair (unless I'm wrong about the array syntax in json):
[ [ [1,1,1,1], [1,1,1,1], [1,1,1,1] ], [ [1,1,1,1], [1,1,1,1], [1,1,1,1] ] ]
Note:
See TracTickets
for help on using tickets.
Example use
encode
A mimetype that also works is "application/json":
decode
Works exactly the same as CSV decode with same parameters, just the format is "json" rather than "csv", e.g: