You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed in a recent project that Google Firestore doesn't allow storage of nested arrays, so any documents that include table blocks get rejected.
I've written a couple of functions to structure the nested arrays as objects on save, and decode them back to nested arrays on fetch (see below), I was wondering if this is something we could consider making a native feature (or an option in the config)?
// Get payload from client...// Encode blocksif(json.content.blocks&&json.content.blocks.length){constfixedBlocks=encodeBlocksForFirestore(json.content.blocks);json.content.blocks=fixedBlocks;}// Save json to DB...
GET
// Retrieve data from DB...// Decode blocksif(json.content&&json.content.blocks.length){constfixedBlocks=decodeBlocksFromFirestore(json.content.blocks);json.content.blocks=fixedBlocks}// Return json to client...
Thanks
The text was updated successfully, but these errors were encountered:
Hi guys, thanks for the awesome tool!
I noticed in a recent project that Google Firestore doesn't allow storage of nested arrays, so any documents that include table blocks get rejected.
I've written a couple of functions to structure the nested arrays as objects on save, and decode them back to nested arrays on fetch (see below), I was wondering if this is something we could consider making a native feature (or an option in the config)?
utils.ts
And then to make use of them on your server:
POST or PATCH
GET
Thanks
The text was updated successfully, but these errors were encountered: