-
-
Notifications
You must be signed in to change notification settings - Fork 519
Closed
Description
Trying to get data from JSON field in PostgreSQL.
my code:
db.Query("messages") .Select("message ->> 'deviceid' AS deviceid", "message ->> 'status' AS status") .Where("CAST ( message->> 'temperature' AS DECIMAL)", ">", 28).Get();
output query :
SELECT "message ->> 'deviceid'" AS "deviceid", "message ->> 'status'" AS "status" FROM "messages" WHERE "CAST ( message->> 'temperature'" AS "DECIMAL)" > 28
expected output :
SELECT message ->> 'deviceid' AS deviceid, message ->> 'status' AS status FROM "messages" WHERE CAST ( message->> 'temperature' AS DECIMAL) > 28
Not sure if it's an issue since JSON(NQSQL) is not supported. But it would be great if I could find a way to get rid of extra quotes.
Any suggestions are appreciated. thanks.
Metadata
Metadata
Assignees
Labels
No labels