-
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug Report: Query.between isn't parsed in the right format #6006
Labels
Comments
gepd
changed the title
🐛 Bug Report: Query.between doesn't have the right format
🐛 Bug Report: Query.between isn't parsed in the right format
Aug 17, 2023
My first though was to change the but seems like the solution isn't here as that query is valid for other cases when you send an array as value |
I don't know if a change like this would be the best solution: static addQuery = (attribute: string, method: string, ...values: any[]) => {
if (method === "between") {
return `${method}("${attribute}", ${values.map((v) => Query.parseValues(v)).join(",")})`;
}
return value instanceof Array
? `${method}("${attribute}", [${value
.map((v) => Query.parseValues(v))
.join(",")}])`
: `${method}("${attribute}", [${Query.parseValues(value)}])`;
}; |
stnguyen90
added
the
product / databases
Fixes and upgrades for the Appwrite Database.
label
Aug 18, 2023
This was referenced Sep 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
👟 Reproduction steps
[between("date", ["2023-08-15T04:00:13.989Z","2023-08-15T07:00:21.100Z"])]
Looking the SDK generator repo, it looks like it's the same for all SDK's https://github.com/appwrite/sdk-generator/blob/master/templates/node/lib/query.js.twig#L27
👍 Expected behavior
It should be:
[between("date", "2023-08-15T04:00:13.989Z","2023-08-15T07:00:21.100Z")]
As workaround it's possible to manually write the query and you can work with it
👎 Actual Behavior
The output is:
[between("date", ["2023-08-15T04:00:13.989Z","2023-08-15T07:00:21.100Z"])]
🎲 Appwrite version
Version 1.3.x
💻 Operating system
Linux
🧱 Your Environment
No response
👀 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: