Skip to content
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

馃悰 Bug Report: NodeJS server SDK doesn't accept any argument for 'default' for creating array attributes in a collection #67

Closed
2 tasks done
algusarov opened this issue Jan 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@algusarov
Copy link

algusarov commented Jan 15, 2024

馃憻 Reproduction steps

I'm using the latest version of node-appwrite (11.1.0) and have set up some scripts to set up my projects programmatically. Everything works fine besides creating array attributes, when I try this code:

await db.createStringAttribute(databaseId, collectionId, 'media', 10000, false, '', true)

it generates this exception:

Cannot set default value for array attributes

message: 'Cannot set default value for array attributes',
    code: 400,
    type: 'attribute_default_unsupported',
    version: '1.4.13'

And when I try to use any other value instead of empty string for a 'default value' parameter, SDK throws another error saying that only string with size 0 can be used as a parameter.

馃憤 Expected behavior

Attribute is created.

馃憥 Actual Behavior

Exception thrown.

馃幉 Appwrite version

Version 0.10.x

馃捇 Operating system

Linux

馃П Your Environment

No response

馃憖 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?

@algusarov algusarov added the bug Something isn't working label Jan 15, 2024
@stnguyen90
Copy link
Contributor

@algusarov, thanks for creating this issue! 馃檹馃徏 This is expected. The goal for setting a default is to not have nulls. This isn't a problem with arrays because they will never be null.

That said, you are more than welcome to add your thoughts to appwrite/console#461 and add a 馃憤馃徏

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants