ย ยทย Figuring it out as I go

Exporting a firestore document as JSON string

I am working on an admin application that is used to navigate and query my firestore database. It would be really convenient if there was a way to take a document object, and copy it to my clipboard as a JSON string so that if I was ever doing some data debugging I could throw it into vs code and format it for ease of use. Currently, I do not see a native way to do that, and the custom functions/actions are pretty foreign to me at this point. I've tried using the copilot, but it will often provide code that has methods that don't exist.

This is my component where I would like to implement the highlighted 'IconButton' to copy the JSON to my clipboard or potentially export as a .json file, though I think the former will be more useful to me.

1
1 reply