2022-01-10 20:25:36 +03:00
|
|
|
def _bson_torepr:
|
|
|
|
def _f:
|
2021-12-28 20:33:18 +03:00
|
|
|
( if .type == null or .type == "array" then
|
|
|
|
( .value.elements
|
2022-01-10 20:25:36 +03:00
|
|
|
| map(_f)
|
2021-12-28 20:33:18 +03:00
|
|
|
)
|
|
|
|
elif .type == "document" then
|
|
|
|
( .value.elements
|
2022-01-10 20:25:36 +03:00
|
|
|
| map({key: .name, value: _f})
|
2021-12-28 20:33:18 +03:00
|
|
|
| from_entries
|
|
|
|
)
|
|
|
|
elif .type == "boolean" then .value != 0
|
2022-01-10 20:25:36 +03:00
|
|
|
else .value | tovalue
|
2021-12-28 20:33:18 +03:00
|
|
|
end
|
|
|
|
);
|
|
|
|
( {type: "document", value: .}
|
2022-01-10 20:25:36 +03:00
|
|
|
| _f
|
2021-12-28 20:33:18 +03:00
|
|
|
);
|