Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6149] ArrowDB (MBS) /events/query does not include Check-Ins or Posts

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusResolved
ResolutionDone
Resolution Date2019-05-08T03:03:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsArrowDB
Labelsn/a
ReporterAdam Armstrong
AssigneeShuo Liang
Created2019-02-25T19:07:20.000+0000
Updated2019-05-08T04:24:44.000+0000

Description

If I run: https://api.cloud.appcelerator.com/v1/events/query.json?limit=500&skip=0&where={"start_time": {"$gte": "TIME_HERE"}}&order=-created_at&response_json_depth=8&pretty_json=true&count=true&key=KEY_HERE using json_depth = 8.... it does NOT include the associated CheckIn or Posts for the Events. It only shows the associated User and Place. Adam

Attachments

FileDateSize
E41A7207-A96B-4B62-9CDF-24272B0BFBDD.png2019-02-28T02:55:43.000+0000351414

Comments

  1. Rakhi Mitro 2019-02-26

    Hello, Thanks for sharing with us. It would be great if you can provide more description about your issue, sample test code and complete error logs to reproduce the issue on our end.
  2. Adam Armstrong 2019-02-26

    Simply create: • Place • Event for that Place • Post for that Event • CheckIn for that Event Then run the REST API I put in the ticket. Your result will produce something like this:
       {
           "meta": {
               "code": 200,
               "status": "ok",
               "method_name": "queryEvents",
               "count": 2
           },
           "response": {
               "events": [
                   {
                       "id": "5c68bba4915408023d06e34f",
                       "name": "Game",
                       "start_time": "2019-03-02T23:00:00+0000",
                       "duration": 4500,
                       "created_at": "2019-02-17T01:40:52+0000",
                       "updated_at": "2019-02-18T21:47:48+0000",
                       "ical": "DTSTART:20190302T230000Z\nDURATION:PT1H15M",
                       "recurring_until": "2019-02-17T01:40:00+0000",
                       "num_occurrences": 1,
                       "details": "Beer afterwards",
                       "custom_fields": {
                           "level": "D2"
                       },
                       "user": {
                           "id": "5c60b264113d2f0243e21033",
                           "tags": [
                               "appcelerator"
                           ],
                           "created_at": "2019-02-10T23:23:16+0000",
                           "updated_at": "2019-02-25T15:21:56+0000",
                           "external_accounts": [],
                           "confirmed_at": "2019-02-10T23:23:16+0000",
                           "username": "appc_app_user_dev",
                           "role": "appc-admin",
                           "admin": "false",
                           "stats": {
                               "photos": {
                                   "total_count": 0
                               },
                               "storage": {
                                   "used": 0
                               }
                           },
                           "friend_counts": {
                               "requests": 0,
                               "friends": 0
                           }
                       },
                       "place": {
                           "id": "5c65ba960a44c3023cfd86fe",
                           "name": "Frisco StarCenter",
                           "created_at": "2019-02-14T18:59:34+0000",
                           "updated_at": "2019-02-14T18:59:34+0000",
                           "address": "2601 Avenue of the Stars",
                           "city": "Frisco",
                           "state": "TX",
                           "postal_code": "75034",
                           "user": {
                               "id": "5c60b264113d2f0243e21033",
                               "tags": [
                                   "appcelerator"
                               ],
                               "created_at": "2019-02-10T23:23:16+0000",
                               "updated_at": "2019-02-25T15:21:56+0000",
                               "external_accounts": [],
                               "confirmed_at": "2019-02-10T23:23:16+0000",
                               "username": "appc_app_user_dev",
                               "role": "appc-admin",
                               "admin": "false",
                               "stats": {
                                   "photos": {
                                       "total_count": 0
                                   },
                                   "storage": {
                                       "used": 0
                                   }
                               },
                               "friend_counts": {
                                   "requests": 0,
                                   "friends": 0
                               }
                           }
                       }
                   },
                   {
                       "id": "5c65bada734fef0244f8c699",
                       "name": "Drop-In",
                       "start_time": "2019-03-08T12:30:00+0000",
                       "duration": 5400,
                       "created_at": "2019-02-14T19:00:42+0000",
                       "updated_at": "2019-02-25T18:58:35+0000",
                       "ical": "DTSTART:20190308T123000Z\nDURATION:PT1H30M",
                       "recurring_until": "2019-02-14T18:59:00+0000",
                       "num_occurrences": 1,
                       "details": "Rise 'N Grind.  Dunkin Donuts provides free coffee & donuts.",
                       "custom_fields": {
                           "level": "All",
                           "age": "Adult"
                       },
                       "user": {
                           "id": "5c60b264113d2f0243e21033",
                           "tags": [
                               "appcelerator"
                           ],
                           "created_at": "2019-02-10T23:23:16+0000",
                           "updated_at": "2019-02-25T15:21:56+0000",
                           "external_accounts": [],
                           "confirmed_at": "2019-02-10T23:23:16+0000",
                           "username": "appc_app_user_dev",
                           "role": "appc-admin",
                           "admin": "false",
                           "stats": {
                               "photos": {
                                   "total_count": 0
                               },
                               "storage": {
                                   "used": 0
                               }
                           },
                           "friend_counts": {
                               "requests": 0,
                               "friends": 0
                           }
                       },
                       "place": {
                           "id": "5c65ba960a44c3023cfd86fe",
                           "name": "Frisco StarCenter",
                           "created_at": "2019-02-14T18:59:34+0000",
                           "updated_at": "2019-02-14T18:59:34+0000",
                           "address": "2601 Avenue of the Stars",
                           "city": "Frisco",
                           "state": "TX",
                           "postal_code": "75034",
                           "user": {
                               "id": "5c60b264113d2f0243e21033",
                               "tags": [
                                   "appcelerator"
                               ],
                               "created_at": "2019-02-10T23:23:16+0000",
                               "updated_at": "2019-02-25T15:21:56+0000",
                               "external_accounts": [],
                               "confirmed_at": "2019-02-10T23:23:16+0000",
                               "username": "appc_app_user_dev",
                               "role": "appc-admin",
                               "admin": "false",
                               "stats": {
                                   "photos": {
                                       "total_count": 0
                                   },
                                   "storage": {
                                       "used": 0
                                   }
                               },
                               "friend_counts": {
                                   "requests": 0,
                                   "friends": 0
                               }
                           }
                       }
                   }
               ]
           }
       }
       
    And having defined response_json_depth=8 I expect to see the related CheckIns and Posts for that Event.
  3. Adam Armstrong 2019-02-27

    At a minimum, the events/query endpoint should at least include the count of Posts associated with the Event, count of CheckIns at an Event, count of Comments on an Event, count of Ratings of an Event, etc.... And honestly, this should be present on all of the endpoints to show the count of all related objects.
  4. Shuo Liang 2019-02-28

    [~amwinsauto] Thank you for your info. And that is expected result. Our system do not return Check-in or Post for Event or Place object query. First of all, Posts and Check-in object is not necessary or unique for event object. Then, An event could having zero or lots of Posts or Check-in object, if data is huge and event query return all those related object as well, that could slow down the query performance, even killing the query server. so, if you want to see the Check-in or Post, please use Check-in or post query instead of Event query.
  5. Adam Armstrong 2019-02-28

    Once I want more info on a given Event, then yes it makes sense to query for the details of the Comments, CheckIns, Posts, etc related to that selected Event. But when querying for all Events, why not at least return the counts? That is reasonable. Let’s say I want to show all Events (let’s say there are 30) in a format similar to Facebook. Then what you’re saying is I would make 1 call to get the events and to then show the # of posts on an event I would then need to make 30 more api calls and loop back through each row to update that #? That is not reasonable and honestly, prevents ArrowDB from even being a usable platform. As an Enterprise user of 4+ years now - this is very concerning that we are even debating the justification of why this product should at least show the counts of the related objects. This is very basic and makes me think I need to re-evaluate my long term plans with this platform going forward.
  6. Shuo Liang 2019-02-28

    Ye. If you really need it, we can file a ticket to cloud team asap, and they will take care of it. We will keep you posted once there is any update from cloud team.
  7. Adam Armstrong 2019-02-28

    !E41A7207-A96B-4B62-9CDF-24272B0BFBDD.png|thumbnail!
  8. Adam Armstrong 2019-02-28

    For example, see that image ^ (Specifically “comments”) Similar to what a Facebook type app would use. Am I honesty the only person that needs the functionality to get a count of all related objects? This seems basic to me for a Mobile “Social” App. If I am truly the only person that has requested, or would use, this functionality then I am shocked. I’m not asking you to do this “for me”. But for the fact that it is basic functionality that would greatly benefit your product for all of your users. Don’t do this only on “my behalf”.
  9. Shuo Liang 2019-05-08

    This problem has been fixed. Now, you can query event with parameters like "events/query.json?post=true&checkin=true", then get count of post and CheckIn object related to current event. E.g. "https://api.cloud.appcelerator.com/v1/events/query.json?key=KMRH9AApw7u6OLYLN0tlc1xXQokKRE0l&pretty_json=true&count=true&response_json_depth=8&post=true&checkin=true"
  10. Adam Armstrong 2019-05-08

    Checkin object? You can have multiple checkins to an Event. Why doesn’t this also provide the count of checkins?
  11. Shuo Liang 2019-05-08

    It does provide count of checkins. Example response:
    {
          "meta": {
            "code": 200,
            "status": "ok",
            "method_name": "queryEvents",
            "count": 1
          },
          "response": {
            "events": [
              {
                "id": "5cd244045097e9021aa93062",
                "name": "TestEvent20190508",
                "start_time": "2019-05-09T02:49:00+0000",
                "duration": 0,
                "created_at": "2019-05-08T02:50:44+0000",
                "updated_at": "2019-05-08T02:50:44+0000",
                "ical": "DTSTART:20190509T024900Z",
                "recurring_until": "2019-05-08T02:49:00+0000",
                "num_occurrences": 1,
                "user": {
                  "id": "56b4543492f6e3e9c98af1de",
                  "first_name": "Test",
                  "last_name": "User A",
                  "created_at": "2016-02-05T07:50:12+0000",
                  "updated_at": "2016-02-05T07:50:12+0000",
                  "external_accounts": [
        
                  ],
                  "confirmed_at": "2016-02-05T07:50:12+0000",
                  "username": "test user a",
                  "role": "Tester",
                  "admin": "false",
                  "stats": {
                    "photos": {
                      "total_count": 0
                    },
                    "storage": {
                      "used": 0
                    }
                  },
                  "friend_counts": {
                    "requests": 0,
                    "friends": 0
                  }
                },
                "place": {
                  "id": "5cd243ec9603040221aa02dd",
                  "name": "TestPlace20190508",
                  "created_at": "2019-05-08T02:50:20+0000",
                  "updated_at": "2019-05-08T02:50:20+0000",
                  "address": "Chaoyang District",
                  "city": "Bejing",
                  "state": "Beijing",
                  "postal_code": "100075",
                  "phone_number": "18518921081",
                  "user": {
                    "id": "56b4543492f6e3e9c98af1de",
                    "first_name": "Test",
                    "last_name": "User A",
                    "created_at": "2016-02-05T07:50:12+0000",
                    "updated_at": "2016-02-05T07:50:12+0000",
                    "external_accounts": [
        
                    ],
                    "confirmed_at": "2016-02-05T07:50:12+0000",
                    "username": "test user a",
                    "role": "Tester",
                    "admin": "false",
                    "stats": {
                      "photos": {
                        "total_count": 0
                      },
                      "storage": {
                        "used": 0
                      }
                    },
                    "friend_counts": {
                      "requests": 0,
                      "friends": 0
                    }
                  }
                },
                "posts": {
                  "count": 0
                },
                "checkins": {
                  "count": 2
                }
              }
            ]
          }
        }
  12. Adam Armstrong 2019-05-08

    Your comment said Check-in object - not count. If it is returning count then that’s great. Thank you!

JSON Source