Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joola SDK query syntax #761

Open
avif opened this issue Jan 9, 2016 · 0 comments
Open

Joola SDK query syntax #761

avif opened this issue Jan 9, 2016 · 0 comments

Comments

@avif
Copy link

avif commented Jan 9, 2016

I'm trying to figure out the query syntax for the sdk, and I'm getting some unexpected behavior.
I'm tying to query all events where type = 'pageView'

My documents look like this:

{
    "type" : "pageView",
    "eventProps" : {
        "pageUrl" : "/"
    },
    "session" : "787a3fe9-4d43-965f-ac13-4b88d3c77e49",
}

And my query looks like this:

Joola.query.fetch({
    timeframe: 'this_day',
    interval: 'minute',
    metrics: [{
      key: 'type'
    }],
    filter: [
      ['type', 'eq', 'pageView']
    ],
    collection: 'analytics-dashboard'
}, function(err, results) {
    console.debug('results: ', results);
});

And the result:

[
  {
    "dimensions": [

    ],
    "metrics": [
      {
        "key": "type",
        "collection": "analytics-dashboard",
        "dependsOn": "type",
        "adhoc": true,
        "name": "type",
        "attribute": "type"
      }
    ],
    "documents": [
      {
        "type": {

        }
      }
    ],
    "uid": "PTB8766GMT5tFUcmO2oEtsqBMWMGOL2B",
    "resultCount": 1,
    "query": {
      "collection": "analytics-dashboard",
      "dontcache": true,
      "filter": [
        [
          "type",
          "eq",
          "pageView"
        ]
      ],
      "realtime": false,
      "interval": "timebucket.minute",
      "timeframe": {
        "start": "2016-01-09T00:00:00.000Z",
        "end": "2016-01-09T16:08:00.446Z"
      },
      "metrics": [
        {
          "key": "type",
          "collection": "analytics-dashboard",
          "dependsOn": "type",
          "adhoc": true,
          "name": "type",
          "attribute": "type"
        }
      ],
      "dimensions": [

      ],
      "uid": "PTB8766GMT5tFUcmO2oEtsqBMWMGOL2B",
      "ts": {
        "start": "2016-01-09T16:08:00.446Z",
        "end": "2016-01-09T16:08:00.449Z",
        "duration": 3
      }
    }
  }
]

As you can see, results[0].documents does not contain the queried documents
am I doing this right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant