I'm trying to update an existing database document's many-to-many assocation via a function but keep getting a Server Error
whenever I attempt this code:
def associate_video_to_playlist(playlist_url, video_id):
playlist_document_id = get_appwrite_playlist_document(playlist_url)['$id']
video_document = get_appwrite_youtube_video_document(video_id)
result = documents.update_document(
APPWRITE_DATABASE_ID,
YOUTUBE_PLAYLIST_COLLECTION_ID,
playlist_document_id,
{
'youtubeVideo': video_document
}
)
# print(f'playlist document: {playlist_document["youtubeVideo"]}')
return playlist_document_id
I'm not sure whether to provide the ID of the associated document, the object itself, or what. I've checked permissions for all associated content.
Recommended threads
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...