-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃殌 Feature: Allow document general attributes on update #4802
Comments
@silberGuy thanks for raising this issue! Could you please provide sample code for this? |
Well, I am not much of a PHP dev, async function updateDoc(collectionId: string, docId: string, docData: Partial<DocType>, permissions?: string[]) {
const updateData = {
...docData,
id: undefined,
$collectionId: undefined,
$createdAt: undefined,
$databaseId: undefined,
$id: undefined,
$permissions: undefined,
}
return await appwriteDbs.updateDocument(
'default', collectionId, docId, updateData, permissions,
)
} and I would love to just use: async function updateDoc(collectionId: string, docId: string, docData: Partial<DocType>, permissions?: string[]) {
return await appwriteDbs.updateDocument(
'default', collectionId, docId, docData, permissions,
)
} I guess we can add similar filtering logic in the JS sdk.
|
@stnguyen90 I agree with @silberGuy. It used to be this way. Now I can send all of the "$" attributes except $databaseId and $collectionId... pick a theme and stick to it please. Having to remove all of the $attributes before updating a document in so many different areas is tiresome and repeating and too many areas to miss. |
馃敄 Feature description
When updating a document from my web app, sometimes we update the document object itself and pass it whole to the update function.
This procedure (which worked before updating from 0.14 to 1.1) now throws the following:
I think that in case that the user of the update function is not trying to change this property, the backend can ignore it.
馃帳 Pitch
I guess that in general, attributes like
$collectionId
should not be used, for the$
prefix indicates a system-level property.My current solution was to filter-out the property, and also
$permissions
,$id
and similar, on client-side level, and his could be spared.馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: