Back

Server-Side function: Creation of 2 different documents in 2 different collection Weirdness

  • 0
  • Databases
  • Functions
D3str0y3d255
29 Jun, 2023, 15:52

Hello all, I was wondering if anyone had some insight into this!

I have a server-side function that will sign up the user and after signing them up creates 2 documents in 2 different collections (within the same DB) Making one document works just fine! Once I add in making the second document (same DB different collection) to my function, it breaks it in a weird way. Signs up user ✅ creates 2 documents ✅

the 2 documents that are supposed to be in 2 different collections end up only going to the first collection and it breaks the documents (No data in either of them), It worked perfectly with creation of one document, but once you add the second document in a different collection it breaks.

any insights into what may be going on, or if im messing up somewhere along the way?

Would it be better to have a secondary function for the 2nd collection/document that triggers within my first function? or upon the execution of the original function?

TL;DR
User is experiencing an issue with a server-side function that creates two documents in two different collections. One document is created successfully, but the second document is not being created properly and both documents appear empty. User is seeking insights or advice on how to fix the issue. User also wonders if creating a separate function for the second document would be a better approach.
D3str0y3d255
29 Jun, 2023, 15:58

Doc IDs replaced (they both have unique IDs (doubt the doc ids are sensetive information but just incase)) This is the view (minus the doc IDs) but the documents show up as completely empty other than an ID

D3str0y3d255
29 Jun, 2023, 19:05

^ For the above realized I was just making a rookie mistake! Figured this out!

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