sdk-for-php icon indicating copy to clipboard operation
sdk-for-php copied to clipboard

🐛 Bug Report: Appwrite\Query::contains(): Argument #2 ($value) must be of type string, array given

Open barart opened this issue 1 year ago • 1 comments
trafficstars

👟 Reproduction steps

Just do a contains query with an array, the same query that is in documentation reproduce this bug: Query.contains("ingredients", ['apple', 'banana'])

👍 Expected behavior

contains query should accept arrays too

👎 Actual Behavior

contains query only accept string

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

Something else

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

barart avatar Mar 24 '24 01:03 barart

The user is experiencing an issue with passing an array value during a search query. The solution is to check if the array is empty and only pass the query if it is not empty. The issue will be fixed in the next version of Appwrite. The user is advised to print the array value before the query to troubleshoot further. The user also mentions confusion between the terms 'enum' and 'array', and the correct usage is clarified.

junaidmugloo avatar May 25 '24 09:05 junaidmugloo