Can't we add attributes dynamically while creating a document in a specific Collection?
- 0
- Databases
- Web

You need to use server sdk to add attributes dynamically

You mean, While creating the document, we have to use Server side sdk to add the data right?

You mean, we have to create a document using Server side sdk using Appwrite Functions right?

Yes you can use Appwrite functions, you can achieve that even without functions

https://appwrite.io/docs/getting-started-for-server
Follow this on how you can create database, colections, attributes etc

Thanks Man

Thanks 🙂

[SOLVED]Can't we add attributes dynamically while creating a document in a specific Collection?

brother, Can I add 4 attributes in of document and 15 attributes in second document. I mean, can I add like this using server SDK?

I mean, Can I add Multiple and different attributes in different documents in the same COLLECTION?

@RohitRanjan In a typical Collection, If one document contains 10 different attributes, another document in the same collection could contain 15 different attributes.

Can I achieve this use case using appwrite server SDK? in the client side using functions?

I dont want to create seperate server .

Can't we add attributes dynamically while creating a document in a specific Collection?

Could Anyone please respond 😦

Your use-case is common and generally very easy todo with NoSQL database. Appwrite's actually MariaDB, which is relational DB.
If I was you I probably won't create the attribute on the fly as it can get crowded real fast. What I suggest is to create the general attributes, for example, for your form case.
- form
- userID
- ... other indexable and searchable fields.
- json
Then inside the json I'll put everything as a json inside a big string attribute.
Also, you can go - I'm not a big fan - into EAV solution - like magento - check about it here. https://www.oscprofessionals.com/blog/understanding-different-layers-of-magento-module-development/

@Binyamin The maximum size is so less, We have to mention the size of the string while uploading it right! So, If it won't be suffice, We can get into trouble right?

The maximum size is so less What you mean? of the string attribute?
You can create a very big attribute as you can see here: https://discord.com/channels/564160730845151244/1116054662999724134/1116057738187919551

If we use, So set it to 16777216 to have unlimited one
, this size, Will it be unlimited?

Up to MariaDB limits.

Okay alright, Is it okay

to create JSON .stringify

Yes,

Will hackathon judges judge me wrongly upon this?

Mmm, on that I can't tell you.
Recommended threads
- Document Permissions ... User array vs T...
In my app, I will have multiple users who need read accesss a document, but ONLY them. Sometimes its 2 people and sometimes it will be 100 but sometimes 5000. ...
- i just have new account and give me this
Phone authentication limit for your organization has exceeded. Please upgrade to a higher plan or update your budget cap. this my first account
- help
My account is omda5554@gmail.com I was blocked and I'm using the API. Can you unblock me since I'm on the paid plan? Tell me the reason so I can fix it.
