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.
Convert Protobuf response to JSON in NodeJS
Asked Answered
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():
© 2022 - 2024 — McMap. All rights reserved.
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 ofseconds
andnanos
– Laws