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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...