-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The following is failing to get records despite the same query works in the Console.
Endpoint:
../productGetByCountries?cx=JP,DE
EdgeFunction Code:
const cx = decodeURIComponent(request.params.cx);
const arrayWithSingleQuotes = cx.split(',').map(item => `'${item}'`);
const outputString = arrayWithSingleQuotes.join(',');
console.log("query: " + `SELECT * FROM products WHERE country IN (${outputString}) LIMIT 5`);
console.log("outputString: " + `${outputString}`);
result = await connection.sql`SELECT * FROM products WHERE country IN (${outputString}) LIMIT 5`;
Log Console:
query: SELECT * FROM products WHERE country IN ('DE','JP') LIMIT 5
outputString: 'DE','JP'
Response:
"result": []
Metadata
Metadata
Assignees
Labels
No labels