π Feature: Auto Serialize payload when creating a document
nove1398 opened this issue Β· comments
nove1398 commented
π Feature description
You should add auto serializing the data
payload when creating Documents
Database.CreateDocument(...)
. This will help minimize the work I need to do to create documents.
π€ Pitch
In my use case, I tried to pass an object to the method as defined below:
var newProfile = Profile.Create(
request.UserId,
request.Car,
request.Country,
request.Duck,
"AutoClose",
request.DateOfBirth,
request.LastTime
);
Database.CreateDocument(
collectionName,
newProfile,
[
Permission.Read(Role.Users("verified")),
Permission.Update(Role.User(request.UserId)),
Permission.Delete(Role.User(request.UserId)),
]);
However it did not work, as Appwrite responded with an error stating Error: Invalid document structure: Missing attribute
. I had to serialize the payload myself before it was accepted. In my request I am just asking for it to be auto serialized by the SDK before transmitting to Appwrite.
π Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct