How do we convert Protobuf response (eg. from Bigtable NodeJS Client) to JSON/String with correct braces. There are some resources for Python or Java(https://code.google.com/archive/p/protobuf-java-format/) but none for NodeJS yet which I have found. I am fairly new to Bigtable and NodeJS.
Asked
Active
Viewed 1.1k times
1 Answers
8
I'm not an expert in nodejs, but it seems like the node protobuf library contains a toObject method that will give you a plain javascript object which you can pass to JSON.stringify():

Igor Bernstein
- 571
- 2
- 5
-
2Unfortunately the `toObject` encoding doesn't correctly implement all fields as it should be the proto documentation. E.g. `TimeStamp` should be returned as an ISO timestamp, but instead is an object with properties of `seconds` and `nanos` – Richard Nov 27 '19 at 15:18