Application id: B80B1EC9-8C65-ABD2-FF0A-437AB4D8E700
I found a consistent bug from /transaction/unit-of-work when I was trying to update One To Many relationship table with Column “Mac” and Schema type “text” with POST content like … “conditional”:“macid = ‘AC:23:3F:A8:07:D4’”
- “conditional”:“firecardnumber = ‘44.45.55’”, says “message”:"Where clause is invalid for
- “conditional”:“firecardnumber = ‘44:45:55’”, says “message”:"Where clause is invalid for
- “conditional”:“firecardnumber = ‘44-45-55’”, creates new parent item but does not create child and says {“operationType”:“SET_RELATION”,“result”:0}
- most likely many others!, please verify with script
My POST:
curl -X POST -H ‘Content-Type:application/json’ ‘https://eu-api.backendless.com/B80B1EC9-8C65-ABD2-FF0A-437AB4D8E700/AAAAAAAAAAAAAAAAAAAAA/transaction/unit-of-work’ -d’{“operations”:[{“operationType”:“CREATE”,“table”:“henkilo”,“opResultId”:“please”,“payload”:{“firstname”:“Katja”,“lastname”:“Kettunen”}},{“operationType”:“SET_RELATION”,“table”:“henkilo”,“payload”:{“parentObject”:{"___ref":true,“opResultId”:“please”,“propName”:“objectId”},“relationColumn”:“fireworkcard”,“conditional”:“firecardnumber = ‘44.45.55’”}}]}’
Response:
{“success”:false,“error”:{“operation”:{“operationType”:“SET_RELATION”,“table”:“henkilo”,“opResultId”:“set_relationhenkilo1”,“payload”:{“conditional”:“firecardnumber = 44:45:55”,“unconditional”:null,“parentObject”:“7A1E6FA5-07E3-4C89-8A90-CEB356263E84”,“relationColumn”:“fireworkcard”}},“message”:“Where clause ‘firecardnumber = 44:45:55’ is invalid”},“results”:null}
My POST:
curl -X POST -H ‘Content-Type:application/json’ ‘https://eu-api.backendless.com/B80B1EC9-8C65-ABD2-FF0A-437AB4D8E700/AAAAAAAAAAAAAAAAAAAAAAA/transaction/unit-of-work’ -d’{“operations”:[{“operationType”:“CREATE”,“table”:“henkilo”,“opResultId”:“please”,“payload”:{“firstname”:“Katja”,“lastname”:“Kettunen”}},{“operationType”:“SET_RELATION”,“table”:“henkilo”,“payload”:{“parentObject”:{"___ref":true,“opResultId”:“please”,“propName”:“objectId”},“relationColumn”:“fireworkcard”,“conditional”:“firecardnumber = ‘44.45.55’”}}]}’
Response:
{“success”:false,“error”:{“operation”:{“operationType”:“SET_RELATION”,“table”:“henkilo”,“opResultId”:“set_relationhenkilo1”,“payload”:{“conditional”:“firecardnumber = 44.45.55”,“unconditional”:null,“parentObject”:“D75ED086-D2A5-48FD-AC4D-1BB40FCCE843”,“relationColumn”:“fireworkcard”}},“message”:“Where clause ‘firecardnumber = 44.45.55’ is invalid”},“results”:null}
My POST:
curl -X POST -H ‘Content-Type:application/json’ ‘https://eu-api.backendless.com/B80B1EC9-8C65-ABD2-FF0A-437AB4D8E700/AAAAAAAAAAAAAAAAAAAAAAAA/transaction/unit-of-work’ -d’{“operations”:[{“operationType”:“CREATE”,“table”:“henkilo”,“opResultId”:“please”,“payload”:{“firstname”:“Katja”,“lastname”:“Kettunen”}},{“operationType”:“SET_RELATION”,“table”:“henkilo”,“payload”:{“parentObject”:{"___ref":true,“opResultId”:“please”,“propName”:“objectId”},“relationColumn”:“fireworkcard”,“conditional”:“firecardnumber = ‘44-45-55’”}}]}’
Response:
{“success”:true,“error”:null,“results”:{“set_relationhenkilo1”:{“operationType”:“SET_RELATION”,“result”:0},“please”:{“operationType”:“CREATE”,“result”:{“firstname”:“Katja”,“created”:1644789771118,“phonenumber”:null,"___class":“henkilo”,“ownerId”:null,“phonenumbervalid”:null,“updated”:null,“objectId”:“A9FD8E27-A806-4FD0-AE34-F71B7970C5BB”,“lastname”:“Kettunen”}}}}