Back

Save JSON in Collection

  • 0
  • Databases
  • Web
  • Cloud
Sanchit Bajaj
13 Feb, 2024, 18:57

I am using Appwrite for my social media application. I have modelled the comments functionality and planning it to be recursive. Now I want to know, how can I configure this functionality in Appwrite Collections. Currently using web sdk with appwrite cloud but planning to migrate on node-appwrite

Sample json for a single post:

TypeScript
{
  "postId": "nvkndfkvnfdk",
  "items": [
    {
      "userId": "dnksndnsdfefw",
      "commentText": "Hello, World!",
      "items": [
        {
          "userId": "dnksndnsdfefw",
          "commentText": "Hello, World!",
          "items": []
        },
        {
          "userId": "dnksndnsdfefw",
          "commentText": "Hello, World!",
          "items": []
        }
      ]
    },
    {
      "userId": "dnksndnsdfefw",
      "commentText": "Hello, World!",
      "items": [
        {
          "userId": "dnksndnsdfefw",
          "commentText": "Hello, World!",
          "items": [
            {
              "userId": "dnksndnsdfefw",
              "commentText": "Hello, World!",
              "items": []
            }
          ]
        }
      ]
    },
    {
      "userId": "dnksndnsdfefw",
      "commentText": "Hello, World!",
      "items": []
    }
  ]
}
TL;DR
Developers using Appwrite for a social media application want to configure recursive comments functionality in Appwrite Collections. They are currently using the web SDK but plan to migrate to node-appwrite. They provide a sample JSON for a single post.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more