[JS] Add DataFrame.toJSON
- Dominant language
- TypeScript
- Stars
- 112
- Forks
- 23
- Avg merge
- 21h 18m
- Merged PRs (30d)
- 8
Description
Currently, `CountByResult` has its own [`toJSON` method](https://github.com/apache/arrow/blob/master/js/src/table.ts#L282), but there should be a more general one for every `DataFrame`.
`CountByResult.toJSON` returns:
```json
{
"keyA": 10,
"keyB": 10,
...
}
```
A more general `toJSON` could just return a list of objects with an entry for each column. For the above `CountByResult`, the output would look like:
```json
[
{value: "keyA", count: 10},
{value: "keyB", count: 10},
...
]
```
**Reporter**: [Brian Hulette](https://issues.apache.org/jira/browse/ARROW-2202) / @TheNeuralBit
**Note**: *This issue was originally created as [ARROW-2202](https://issues.apache.org/jira/browse/ARROW-2202). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Assessment
This issue has not been assessed yet.