{ "id": "108138", "key": "AC-2640", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2014-01-17T07:18:06.000+0000", "created": "2013-01-19T19:18:19.000+0000", "labels": [ "acs" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:44.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14552", "name": "Appcelerator CLI", "description": "Please enter tickets related to Tooling and the CLI here" } ], "description": "You cannot really use $or in queries on custom objects.\r\n\r\nSomething like:\r\n\r\nwhere = {\r\n\t\t'$or' : [{\r\n\t\t\tname : 'dbb'\r\n\t\t}, {name : 'abc'}]\r\n\t}\r\n\r\ndoesn't really return anything meaningful. Depending on what the query is, it sometimes returns the objects that match one of the conditions (and not the other one) and sometimes returns nothing (an empty array).\r\n\r\nWhen you use any of the conditions individually, they work fine (not with $or).\r\n\r\n", "attachment": [], "flagged": false, "summary": "$or operator doesn't properly work in ACS custom objects", "creator": { "name": "ffadaie", "key": "ffadaie", "displayName": "farid fadaie", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ffadaie", "key": "ffadaie", "displayName": "farid fadaie", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "245762", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "\"$or\" is not a parameter according to our documentation. \r\nhttp://cloud.appcelerator.com/docs/api/v1/custom_objects/query", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-04T18:46:36.000+0000", "updated": "2013-04-04T18:46:36.000+0000" }, { "id": "288589", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We have not been able to reproduce this issue with custom objects. It is also possible that this issue was fixed after it was reported. Here is the query that I used to verify that this functionality works fine.\r\n\r\n{code}\r\nCloud.Objects.query({\r\n classname: 'car',\r\n page: 1,\r\n per_page: 10,\r\n where: {\r\n // color: 'blue'\r\n '$or' : [{color : 'red'}, {color : 'black'}]\r\n }\r\n}, function (e) {\r\n if (e.success) {\r\n alert('Success:\\n' +\r\n 'Count: ' + e.car.length);\r\n for (var i = 0; i < e.car.length; i++) {\r\n var car = e.car[i];\r\n alert('id: ' + car.id + '\\n' +\r\n 'make: ' + car.make + '\\n' +\r\n 'color: ' + car.color + '\\n' +\r\n 'year: ' + car.year + '\\n' +\r\n 'created_at: ' + car.created_at);\r\n }\r\n } else {\r\n alert('Error:\\n' +\r\n ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n});\r\n{code}", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-17T07:18:06.000+0000", "updated": "2014-01-17T07:18:31.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }