Unable to serialize backend response in ember data - ember.js

I am trying to access the pagination variables in the response such as page_number, total_pages inside my controller as I have introduced this feature just now to this legacy code in the backend and now I am stuck how can I read those data and go further.
My serializer code
import DS from 'ember-data';
var underscore = Ember.String.underscore;
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
rules: {
embedded: 'always'
},
test_cases: {
serialize: "id",
deserialize: 'records'
},
},
keyForRelationship: function (rawKey) {
return underscore(rawKey) + "_id";
}
})
route.js
import Route from '#ember/routing/route';
import { hash } from 'rsvp'
import ResetScrollMixin from 'admin-frontend/mixins/reset-scroll-mixin'
export default Route.extend(ResetScrollMixin, {
model(params) {
return hash({
ruleSetVersions: this.store.query('rule-set-version', {
rule_set_id: params.rule_set_id,
is_archived: false,
page: '1'
}),
ruleSet: this.store.findRecord('rule-set', params.rule_set_id)
})
}
});
And response json looks like
{
"page_number": 1,
"page_size": 5,
"rule_set_versions": [{
"id": 930,
"last_updated_by": 1,
"created_by": 1,
"default_rule_id": 963,
"is_live": true,
"is_archived": false,
"start_time": "2020-12-30T18:30:00Z",
"rule_set_id": 11,
"rules": [{
"id": 963,
"priority": 10000001,
"conditions": [],
"results": [{
"id": 59,
"operator": null,
"value": "00",
"rule_id": 963,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:38Z",
"datatype": "integer",
"id": 34,
"name": "edd_result",
"property_category": "result",
"updated_at": "2020-11-18T10:01:38Z",
"validations": {
"max": 99999,
"min": 0
}
},
"created_at": "2020-11-18T10:10:41Z",
"updated_at": "2020-11-18T10:10:41Z"
}],
"created_at": "2020-11-18T10:10:32Z",
"updated_at": "2020-11-18T10:10:32Z"
}, {
"id": 971,
"priority": 1,
"conditions": [{
"id": 57,
"comparator": "equal_to",
"value": "100",
"rule_id": 971,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:05Z",
"datatype": "text",
"id": 33,
"name": "edd_con",
"property_category": "condition",
"updated_at": "2020-11-18T10:01:05Z",
"validations": {}
},
"created_at": "2020-12-23T09:05:04Z",
"updated_at": "2020-12-23T09:05:04Z"
}],
"results": [{
"id": 66,
"operator": null,
"value": "100",
"rule_id": 971,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:38Z",
"datatype": "integer",
"id": 34,
"name": "edd_result",
"property_category": "result",
"updated_at": "2020-11-18T10:01:38Z",
"validations": {
"max": 99999,
"min": 0
}
},
"created_at": "2020-12-23T09:05:10Z",
"updated_at": "2020-12-23T09:05:10Z"
}],
"created_at": "2020-12-23T09:04:54Z",
"updated_at": "2020-12-23T09:04:54Z"
}],
"created_at": "2020-11-18T10:10:32Z",
"updated_at": "2020-12-23T09:06:04Z"
}, {
"id": 932,
"last_updated_by": 1,
"created_by": 1,
"default_rule_id": 969,
"is_live": true,
"is_archived": false,
"start_time": "2020-11-25T18:30:00Z",
"rule_set_id": 11,
"rules": [{
"id": 969,
"priority": 10000001,
"conditions": [],
"results": [{
"id": 64,
"operator": null,
"value": "1000",
"rule_id": 969,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:38Z",
"datatype": "integer",
"id": 34,
"name": "edd_result",
"property_category": "result",
"updated_at": "2020-11-18T10:01:38Z",
"validations": {
"max": 99999,
"min": 0
}
},
"created_at": "2020-11-25T11:53:58Z",
"updated_at": "2020-11-25T11:53:58Z"
}],
"created_at": "2020-11-25T11:53:49Z",
"updated_at": "2020-11-25T11:53:49Z"
}, {
"id": 970,
"priority": 1,
"conditions": [{
"id": 56,
"comparator": "equal_to",
"value": "100",
"rule_id": 970,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:05Z",
"datatype": "text",
"id": 33,
"name": "edd_con",
"property_category": "condition",
"updated_at": "2020-11-18T10:01:05Z",
"validations": {}
},
"created_at": "2020-11-25T11:54:11Z",
"updated_at": "2020-11-25T11:54:11Z"
}],
"results": [{
"id": 65,
"operator": null,
"value": "100",
"rule_id": 970,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:38Z",
"datatype": "integer",
"id": 34,
"name": "edd_result",
"property_category": "result",
"updated_at": "2020-11-18T10:01:38Z",
"validations": {
"max": 99999,
"min": 0
}
},
"created_at": "2020-11-25T11:54:16Z",
"updated_at": "2020-11-25T11:54:16Z"
}],
"created_at": "2020-11-25T11:54:03Z",
"updated_at": "2020-11-25T11:54:03Z"
}],
"created_at": "2020-11-25T11:53:49Z",
"updated_at": "2020-11-25T11:55:12Z"
}, {
"id": 934,
"last_updated_by": 1,
"created_by": 1,
"default_rule_id": 974,
"is_live": false,
"is_archived": false,
"start_time": "2020-12-30T18:30:00Z",
"rule_set_id": 11,
"rules": [{
"id": 974,
"priority": 10000001,
"conditions": [],
"results": [{
"id": 69,
"operator": null,
"value": "00",
"rule_id": 974,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:38Z",
"datatype": "integer",
"id": 34,
"name": "edd_result",
"property_category": "result",
"updated_at": "2020-11-18T10:01:38Z",
"validations": {
"max": 99999,
"min": 0
}
},
"created_at": "2021-03-11T10:55:44Z",
"updated_at": "2021-03-11T10:55:44Z"
}],
"created_at": "2021-03-11T10:55:44Z",
"updated_at": "2021-03-11T10:55:44Z"
}, {
"id": 976,
"priority": 1,
"conditions": [{
"id": 60,
"comparator": "equal_to",
"value": "100",
"rule_id": 976,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:05Z",
"datatype": "text",
"id": 33,
"name": "edd_con",
"property_category": "condition",
"updated_at": "2020-11-18T10:01:05Z",
"validations": {}
},
"created_at": "2021-03-12T16:18:04Z",
"updated_at": "2021-03-12T16:18:04Z"
}],
"results": [{
"id": 71,
"operator": null,
"value": "100",
"rule_id": 976,
"rule_set_metadatum": {
"created_at": "2020-11-18T10:01:38Z",
"datatype": "integer",
"id": 34,
"name": "edd_result",
"property_category": "result",
"updated_at": "2020-11-18T10:01:38Z",
"validations": {
"max": 99999,
"min": 0
}
},
"created_at": "2021-03-12T16:18:10Z",
"updated_at": "2021-03-12T16:18:10Z"
}],
"created_at": "2021-03-12T16:17:55Z",
"updated_at": "2021-03-12T16:17:55Z"
}],
"created_at": "2021-03-11T10:55:44Z",
"updated_at": "2021-03-11T10:55:44Z"
}],
"total_entries": 3,
"total_pages": 1
}
I am able to read and parse all the data inside the rule_set_versions array but I am unable to access the pagination params that are out side it.
Ember noob here.

Related

ChartJS How to provide an array of objects as a dataset?

I've got a dataset that looks like so;
[
"transactions": [
{
"month": "Dec",
"data": [
{
"id": "333a32c6-eaf0-3f11-8a2b-963282fb700c",
"amount": "776",
"created_at": "2019-12-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
},
{
"id": "36688452-92f2-3ae7-911a-9543fe29cae6",
"amount": "1798",
"created_at": "2019-12-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
},
{
"id": "67856ceb-1eb5-369b-b3c1-7bd92c037c70",
"amount": "9507",
"created_at": "2019-12-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
},
{
"id": "7e9465be-0151-3828-b429-2b7c4db2aa5e",
"amount": "944",
"created_at": "2019-12-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
},
{
"id": "dd5019b5-690b-33e0-a633-de6162cd687a",
"amount": "5327",
"created_at": "2019-12-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
},
{
"id": "eb5f1473-e871-357d-be3c-af2dc00ff22d",
"amount": "4638",
"created_at": "2019-12-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
}
]
},
{
"month": "Mar",
"data": [
{
"id": "5929f7ad-7ad5-35dc-9935-c06bc0283f20",
"amount": "5251",
"created_at": "2019-03-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
}
]
},
{
"month": "Nov",
"data": [
{
"id": "8c36b5dd-2b15-3024-83f4-551df33d9fcc",
"amount": "3643",
"created_at": "2019-11-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
},
{
"id": "abcd4af5-7a7e-3a9b-8c02-f251f6724062",
"amount": "2622",
"created_at": "2019-11-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
}
]
},
{
"month": "Oct",
"data": [
{
"id": "925b5efb-7933-396e-96ab-9473a93009ff",
"amount": "8674",
"created_at": "2019-10-04 10:57:50",
"updated_at": "2019-12-04 10:57:50"
}
]
}
]
]
Basically I want to show a chart with all the months of the year, and if they aren't present in the transactions array, it returns just 0 for that month on the chart.
How would I go about parsing this object and making sure it all matches up with my labels on my chart? All examples in the documentation use really basic integer's as the dataset and there are no examples I could find of using an object!

Combining "bool" and "terms" query in ElasticSearch v6.2 (on AWS)

I am trying to debug an ElasticSearch query and I could use some help with figuring out what I am doing wrong here.
The problem I am having is when I add a "terms" query on a field, no hits are found when I expect results back.
This is the query WITHOUT the "terms" part:
GET /activity/doc/_search
{
"query":{
"bool":{
"must": [
{
"range": {
"ageMax": {
"gte": 20
}
}
},
{
"range": {
"ageMin": {
"lte": 28
}
}
},
{
"range":{
"activityDate":{
"gte":"2019-06-12T16:23:12.709Z"
}
}
},
{
"geo_distance":{
"distance":"50.0km",
"location.gps":{
"lon":-122.406417,
"lat":37.785834
}
}
}
]
}
}
}
This is the result I get back:
{
"took": 7,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 4,
"hits": [
{
"_index": "activity",
"_type": "doc",
"_id": "f35980fe-94cb-4c4a-9ee7-84dbace823b0",
"_score": 4,
"_source": {
"ageMax": 68,
"__typename": "Activity",
"photo": {
"bucket": "vevivo8106a3b4577d41ec943f5ff2d7536d38-develop",
"region": "eu-west-1",
"Key": "Facebook_137538237374224/FA5A7B52-48E6-4816-85FD-06AD04721FBF.jpg",
"url": "https://vevivo8106a3b4577d41ec943f5ff2d7536d38-develop.s3.eu-west-1.amazonaws.com/public/Facebook_137538237374224/FA5A7B52-48E6-4816-85FD-06AD04721FBF.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQUVMMI25HVHW4O5W%2F20190611%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20190611T202205Z&X-Amz-Expires=900&X-Amz-Security-Token=AgoGb3JpZ2luENj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCWV1LXdlc3QtMSKAAoIYw2UKtl9sRiRSxJ6OpnAhQ1GT4WfSzCWQybWB1ufO%2BGUTP4GFNuB7nmq5Y3wOvhmGdMbCY54Do5GGA1GpW3c0OzUtzu%2FKm5AreF8gLSwcqYBoVCiiPlEHhsJ%2FUINKCdwcFp%2BNWs5czT%2Fj%2BrPa8yqBkQxVbxAc%2BoMxadBhvARlPoYcqdR25vnbaoDewiS%2BFE7UjbvF0HvLcu8G2S6Dgy9r1w0tnZIzj512WsOwj0AsM5MFr7ut1xUdOuyJq8sC4BV8xa8FR7VKFEdYpYJyfId%2B0sTQZcv%2FbOHKDCvdRTvDtzez3GXj6nrEon5mRG81cJdYlRMRWaoEBvbG1Mn0pesqrwUIrf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgwwNDQzODQ5Mjk0NjYiDG%2FxkEMhjuwECcH1%2FyqDBUf9AxuOCXR%2B5MtZfA%2BceNx7gzsai7LmfFpPQcYqd0xv5M0VzkUiPCD5wUP417qDzX5KC9Zft%2BX9C2RKYJoxd0%2Bav%2BsQoN62Mld0wuDRykISJTd5Qknq8FFvWKznD%2BTh2jr%2BWD2LYwhw3gt07p9LZwi9BKV67ktzo5rK77XTLfCFKDZBDiyEUWyrBea1%2BZt45p%2F5O6S7D7yxW0GFYXXrwLfbg2FGJikXDVwmcHnw5s8oh6b9UFNJUZzqllXYA7Tg8S0nkixZuu1O4OBU6mht7YhPng2%2FZLy0k%2FyoaLggHc3lbPpQJYSj1XIXqbZlbS5wSKZyivkUuBJAMFNLcRgj%2BpA0TYCGTwF2zZgxwvWm3H%2B7NDvH%2FrnQajW7ANna6HhS1WZ4fEtnFWNWxArjCJoQk5hQPnkyWyeQda9aAMBDr72hhRTw8PTZkim6nSKxwM4UnQ4jElopt0UbXSKQxusZJFo%2F0UZAgdWg00TdjIgVs3q%2BZ9CMS5jt%2BTbatrCDWDIXKIEuMrqqKanrPDfq60hV0I2BP8poTGT3RczVE7tbfeMLui3E5jGvP9xkoCZfWt9GXZvQWTXinilVonPkHRVGa7sqhygcYh9TmhO18eKiBk7mwO1cwIKlRfTZJBr%2F1xu3IP7oKBG8AOwjSJJx0fDpRLUMCWH%2BC%2BHNiAqjRpShCvX3OFOFRygMa50C0ocdlGrEtKDZBXa2%2BSW4WR0LEeozMeWjJTPF9iA%2FE8GyCscdnx2bMAhccJupAplL7UhCMTdRCJ2SalnNJR7Q49LvG4ryG8OdxhhYZD4n51wVVWlB7fqsP%2Bki8feH77jokiofq3eOU9jFk3SaxbfkzB8%2FcVhtzCrS%2BSswvZaA6AU%3D&X-Amz-Signature=399ae23fe3f01338d1bf79b918c9ce51ffa91c8f705d62ea3b516b0341b60578&X-Amz-SignedHeaders=host"
},
"dateModified": "2019-06-11T20:21:52.870Z",
"version": 1,
"usersWatching": 0,
"createdAt": "2019-06-11T20:22:43.215Z",
"likesCount": 0,
"textData": "Watch a dance movie?",
"enrolledUsers": 0,
"activityDate": "2019-06-19T20:12:44.000Z",
"ageMin": 18,
"dateCreated": "2019-06-11T20:21:52.870Z",
"peopleRequested": 2,
"commentsCount": 0,
"location": {
"address": {
"zipcode": "94108",
"country": "United States",
"city": "San Francisco",
"street": "Stockton St",
"state": null
},
"gps": {
"lon": -122.406417,
"lat": 37.785834
}
},
"enrollmentRequests": 0,
"id": "f35980fe-94cb-4c4a-9ee7-84dbace823b0",
"activityCreatorId": "Facebook_137538237374224",
"category": "Movies::Ballet",
"updatedAt": "2019-06-11T20:22:43.215Z"
}
},
{
"_index": "activity",
"_type": "doc",
"_id": "ce9ab1ee-8fa8-42dd-aeb8-c1a9f58ab6b3",
"_score": 4,
"_source": {
"ageMax": 68,
"__typename": "Activity",
"photo": {
"bucket": "vevivo8106a3b4577d41ec943f5ff2d7536d38-develop",
"region": "eu-west-1",
"Key": "Facebook_137538237374224/FF8E51D9-279B-4EC2-9461-55E2CBFC637A.jpg",
"url": "https://vevivo8106a3b4577d41ec943f5ff2d7536d38-develop.s3.eu-west-1.amazonaws.com/public/Facebook_137538237374224/FF8E51D9-279B-4EC2-9461-55E2CBFC637A.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQUVMMI25F4QOD3PE%2F20190611%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20190611T203152Z&X-Amz-Expires=900&X-Amz-Security-Token=AgoGb3JpZ2luENj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCWV1LXdlc3QtMSKAAhy6dUpwqL9847F4NppRj%2FsFwXtJgJQk%2BK6fsSlAzfUwJGEXEDhGrOEs45HiOpHAEN5YoEskPEb6YpfUdLpXanO5TaYp%2F4Q4uiMMTcR9PVPg%2BVFUylTYJQ%2BskQDcqJw%2BPqppZiWvMMEzJNkB335B6gyqLgsJWyl0okgKLknVVKTJAntsGiqfX%2FvVFk94aoMP0Ubv3ymXyxZ9dxqA5Mqe6EbNoxteQMdLQqoZPfXiGQmvDjgfpZph2SCkkOSwp1slGF0vCjOIztj%2B4Rsfq9jfI14Ks6th25SHOZjeB0HEx497KgFyYQFp41ke8u4WsJ91alv8fGpyMhId2b8v%2F%2BwkNsgqrwUIrv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgwwNDQzODQ5Mjk0NjYiDOiqDscm7ZoQvO8lWCqDBZB56K6XqJ565o1bnZc%2Bh5x9JHeAU8kOcaDvSfa8syzOCQTSW%2BORfmPJzKDij5DN%2B4QFSvycY%2BuU%2FTQqfB6F3bbfD8rLr1HsVBFaKzwIOA6RSEDolCJb3Q2ZyazfFPuzOof3BlEFKYrUoqO1x5Ur0K3z8DRsst7TyAMBPxiYnN%2BZMzsxjFXRz7ps24suwvO3Urz0zogJWGP%2FxSvX%2F6386bTo8X9oIPAVhwdjEebzYATCfe02IRPUxXGQHyZ3qVF5Ccy7zioLW2iNVUQawCN26lfcoUq79xt%2F9mygFM36Xyr3cC0EH5dV5hIj6f%2F9GDvjb%2FLex0c3XPBtzgDDdJoLPgU4UFdIyhYlHNrUZN40vpLZqJIBKQkjyUcoSkzW0dhCx0DukjimLScwwUPxEtSb%2BKqk94zbsZUJjnSBzcGf2DjbCYbDs5EZqg0pm8iVCFtAJODIDLktwZUhl%2BCrv9JYv8epzQgIBDBUIPjeudOMLodahv%2BfFwHl9lRLNUZkDPGgmhIby62J5y2pkoJE353mKPs%2BDvqkmqTMy2377DH1IOsrPRmkgWldPpv4uFD5jKN3r9xxQv4LUswzD%2FfPSBG2pgvaUgeE2YcWg3o6CcW4KtUOPLucHLw66lkgcnQ8M9feo3j35z%2B9lSblNTd6rCuVgrxa9zuRzNxpRl37ZSut%2B7VPy%2FcKN05mHsZfvIBVcPXF4SdQwgnH2%2BZz4fNEU75MRLyqud7rKQ47h2pamKL%2F%2BUqPn8tNlAAZNMpQHh1KAyIrE35WBbIMgAZSVRUeXcvHVONTJrMbeVC%2FZ0EYAfnCR8uxBsGWPIcsObXN%2FJAGbLGcMW5QB%2Bu1MTSI0qbLoxtzxK9r9lQwzZ6A6AU%3D&X-Amz-Signature=5bdfec0ae588f234af3f8e6dd75c3c7ed8f85fdb3c333c895d02c6f63bf0a548&X-Amz-SignedHeaders=host"
},
"dateModified": "2019-06-11T20:31:31.646Z",
"version": 1,
"usersWatching": 0,
"createdAt": "2019-06-11T20:32:51.687Z",
"likesCount": 0,
"textData": "Anyone for a dance movie?",
"enrolledUsers": 0,
"activityDate": "2019-06-21T20:31:23.000Z",
"ageMin": 18,
"dateCreated": "2019-06-11T20:31:31.646Z",
"peopleRequested": 2,
"commentsCount": 0,
"location": {
"address": {
"zipcode": "94108",
"country": "United States",
"city": "San Francisco",
"street": "Stockton St",
"state": null
},
"gps": {
"lon": -122.406417,
"lat": 37.785834
}
},
"enrollmentRequests": 0,
"id": "ce9ab1ee-8fa8-42dd-aeb8-c1a9f58ab6b3",
"activityCreatorId": "Facebook_137538237374224",
"category": "Movies::Romance",
"updatedAt": "2019-06-11T20:32:51.687Z"
}
},
{
"_index": "activity",
"_type": "doc",
"_id": "309db646-903c-471e-b045-b1f55ae6cff0",
"_score": 4,
"_source": {
"ageMax": 68,
"__typename": "Activity",
"photo": {
"bucket": "vevivo8106a3b4577d41ec943f5ff2d7536d38-develop",
"region": "eu-west-1",
"Key": "Facebook_137538237374224/18BB874D-F59C-4924-8764-75A25020C61C.jpg",
"url": "https://vevivo8106a3b4577d41ec943f5ff2d7536d38-develop.s3.eu-west-1.amazonaws.com/public/Facebook_137538237374224/18BB874D-F59C-4924-8764-75A25020C61C.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQUVMMI25F4QOD3PE%2F20190611%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20190611T203026Z&X-Amz-Expires=900&X-Amz-Security-Token=AgoGb3JpZ2luENj%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCWV1LXdlc3QtMSKAAhy6dUpwqL9847F4NppRj%2FsFwXtJgJQk%2BK6fsSlAzfUwJGEXEDhGrOEs45HiOpHAEN5YoEskPEb6YpfUdLpXanO5TaYp%2F4Q4uiMMTcR9PVPg%2BVFUylTYJQ%2BskQDcqJw%2BPqppZiWvMMEzJNkB335B6gyqLgsJWyl0okgKLknVVKTJAntsGiqfX%2FvVFk94aoMP0Ubv3ymXyxZ9dxqA5Mqe6EbNoxteQMdLQqoZPfXiGQmvDjgfpZph2SCkkOSwp1slGF0vCjOIztj%2B4Rsfq9jfI14Ks6th25SHOZjeB0HEx497KgFyYQFp41ke8u4WsJ91alv8fGpyMhId2b8v%2F%2BwkNsgqrwUIrv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgwwNDQzODQ5Mjk0NjYiDOiqDscm7ZoQvO8lWCqDBZB56K6XqJ565o1bnZc%2Bh5x9JHeAU8kOcaDvSfa8syzOCQTSW%2BORfmPJzKDij5DN%2B4QFSvycY%2BuU%2FTQqfB6F3bbfD8rLr1HsVBFaKzwIOA6RSEDolCJb3Q2ZyazfFPuzOof3BlEFKYrUoqO1x5Ur0K3z8DRsst7TyAMBPxiYnN%2BZMzsxjFXRz7ps24suwvO3Urz0zogJWGP%2FxSvX%2F6386bTo8X9oIPAVhwdjEebzYATCfe02IRPUxXGQHyZ3qVF5Ccy7zioLW2iNVUQawCN26lfcoUq79xt%2F9mygFM36Xyr3cC0EH5dV5hIj6f%2F9GDvjb%2FLex0c3XPBtzgDDdJoLPgU4UFdIyhYlHNrUZN40vpLZqJIBKQkjyUcoSkzW0dhCx0DukjimLScwwUPxEtSb%2BKqk94zbsZUJjnSBzcGf2DjbCYbDs5EZqg0pm8iVCFtAJODIDLktwZUhl%2BCrv9JYv8epzQgIBDBUIPjeudOMLodahv%2BfFwHl9lRLNUZkDPGgmhIby62J5y2pkoJE353mKPs%2BDvqkmqTMy2377DH1IOsrPRmkgWldPpv4uFD5jKN3r9xxQv4LUswzD%2FfPSBG2pgvaUgeE2YcWg3o6CcW4KtUOPLucHLw66lkgcnQ8M9feo3j35z%2B9lSblNTd6rCuVgrxa9zuRzNxpRl37ZSut%2B7VPy%2FcKN05mHsZfvIBVcPXF4SdQwgnH2%2BZz4fNEU75MRLyqud7rKQ47h2pamKL%2F%2BUqPn8tNlAAZNMpQHh1KAyIrE35WBbIMgAZSVRUeXcvHVONTJrMbeVC%2FZ0EYAfnCR8uxBsGWPIcsObXN%2FJAGbLGcMW5QB%2Bu1MTSI0qbLoxtzxK9r9lQwzZ6A6AU%3D&X-Amz-Signature=5c5f8e0237e7dc3725617a82db97dfd37c87fe3872a85eabb883100f41aa26e1&X-Amz-SignedHeaders=host"
},
"dateModified": "2019-06-11T20:30:14.449Z",
"version": 1,
"usersWatching": 0,
"createdAt": "2019-06-11T20:31:25.613Z",
"likesCount": 0,
"textData": "Romance Movie Anyone?",
"enrolledUsers": 0,
"activityDate": "2019-06-14T20:31:17.000Z",
"ageMin": 18,
"dateCreated": "2019-06-11T20:30:14.449Z",
"peopleRequested": 1,
"commentsCount": 0,
"location": {
"address": {
"zipcode": "94108",
"country": "United States",
"city": "San Francisco",
"street": "Stockton St",
"state": null
},
"gps": {
"lon": -122.406417,
"lat": 37.785834
}
},
"enrollmentRequests": 0,
"id": "309db646-903c-471e-b045-b1f55ae6cff0",
"activityCreatorId": "Facebook_137538237374224",
"category": "Movies::Romance",
"updatedAt": "2019-06-11T20:31:25.613Z"
}
},
{
"_index": "activity",
"_type": "doc",
"_id": "3a7c629e-803d-4fb9-8b7c-5fac08255649",
"_score": 4,
"_source": {
"ageMax": 62,
"__typename": "Activity",
"photo": {
"bucket": "vevivo8106a3b4577d41ec943f5ff2d7536d38-develop",
"region": "eu-west-1",
"Key": "d70053b2-cbf2-47ea-959e-6b081e00dac9/ECEFB5DB-0F32-4142-A26C-10B7ED120452.jpg",
"url": "https://vevivo8106a3b4577d41ec943f5ff2d7536d38-develop.s3.eu-west-1.amazonaws.com/public/d70053b2-cbf2-47ea-959e-6b081e00dac9/ECEFB5DB-0F32-4142-A26C-10B7ED120452.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQUVMMI25EVY5X32Z%2F20190612%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20190612T125107Z&X-Amz-Expires=900&X-Amz-Security-Token=AgoGb3JpZ2luEOn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCWV1LXdlc3QtMSKAAhT4eq9r4GURlO%2B6hQW0PAMKVmFBUtHaI14%2Fz3i0p3WBjCHnlT49PoOXHaUgZKUVWqDQYKsSWthth%2FfV5k%2BRN76Nce%2BZKNfa9Gzpy%2BCUHVY34koYZSPo%2FFLC%2Be5ox3RBBgrpkB%2BzPHkuc4KNyPKIoSr%2BOHolUhRMZIOmRL84lzzttazBpgwIqxacKo6DQha2k%2FJTh5v%2FqDUXxLwr8Bj0DMRVx7PZg4MxLFSAZ0lShUa7H%2BpHKxkA%2F9wFcTPCK32HuvAub32O1qn1N8zBJxqZhLa5YtBA0vydq%2BIUHPsYePDryc0jTmz4MNVcQsrTPddOPkDoD1qX%2BI1pXEStBPV3EPkqrwUIvv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARACGgwwNDQzODQ5Mjk0NjYiDDCSdZ%2BxIQDybtgqASqDBQC%2BvI1sG5B9CqFZNNSl9qiRMnqbvQJ3WU57qsiz4kJftgMBU0nMdhl97p6mDXhJBvqC2vTgnnGiTbrRMr7%2BvNbNzbigkUO0exM%2B7bqxt6ij%2B8gz%2FdLd8T5Faj8j6AzvKGtwHxaGvaG0tCxvJGD%2BNYzOJxS8mae%2Fvf6qgpH%2BzQaf057NaZ9KsNlFZfCDD2CpBT%2FmB05tnzPmLDy5amzyuCyLWZgi7fzB6mqcKBmN0DktWb6RPRyaNFFi6PaJwHIDF%2BL1B3jx%2BmOXMon2Xwki8j9WugGWhQvMAl%2Fug82QoX1bxHegymeesIG052D6e%2F5XieeDwUZZ5IQinTx3eqs3m%2BqFlkxdIRb3JoPRldVm8hNUHG59mEI01r16%2B5SjTJ%2B4yvVR3x2%2BkGV2DY%2FjV5K8PueUHsIlN2hMGepG%2F7Rwg5fMdgg0YX3zEHZuyVdGvcQtXJbpmpYXxsXmRBkhIt3n59%2FtypAKHP1yLzV2Gxp2aYwUGiDVvn%2BsPHlfFL2FM4eil8g6%2FQVmSjZlw3Wa9Ke5HhIq5RV8la4TyOa7ogoAmoiVTlvqNvYgWlWrxl9zij4MgNwZ3S5Z79svhUNS8zHPDCtHru%2FXj81AUaTDsFSU%2BcVH%2BfKZuYVp3xWFAMSWhD3RQ5RT%2B8zCSKfvcI7hnI2i%2BhvAFFdqD8yPKBQ0A17LyYBc%2FAG91JDvw8lOM8fbmHQiMcmnd62V%2FE9RoQ0OAf3mrobMulrwxLKoQd%2F%2F9Hf8G7fVZZFP5jnIDVkIZScY8pZkzjYgftscGjagStFm4UtjM3KKWkBW5kb3zQREEFl9lUNrna4I89rVwxGxHcj0yVso18If2VPv932VzI2b455B2cbLGnswh%2BqD6AU%3D&X-Amz-Signature=72ac408bd3e51780c2ce3a44843365ca70550d07e0d7eb1e8781968ca5bf854e&X-Amz-SignedHeaders=host"
},
"dateModified": "2019-06-12T12:50:51.986Z",
"version": 1,
"usersWatching": 0,
"createdAt": "2019-06-12T12:52:28.461Z",
"likesCount": 0,
"textData": "Movie night?",
"enrolledUsers": 0,
"activityDate": "2019-06-14T12:50:14.000Z",
"ageMin": 18,
"dateCreated": "2019-06-12T12:50:51.986Z",
"peopleRequested": 1,
"commentsCount": 0,
"location": {
"address": {
"zipcode": "94108",
"country": "United States",
"city": "San Francisco",
"street": "Stockton St",
"state": null
},
"gps": {
"lon": -122.406417,
"lat": 37.785834
}
},
"enrollmentRequests": 0,
"id": "3a7c629e-803d-4fb9-8b7c-5fac08255649",
"activityCreatorId": "d70053b2-cbf2-47ea-959e-6b081e00dac9",
"category": "Movies::Ballet",
"updatedAt": "2019-06-12T12:52:28.461Z"
}
}
]
}
}
When I add the "terms" query in the filter like this:
GET /activity/doc/_search
{
"query":{
"bool":{
"must": [
{
"range": {
"ageMax": {
"gte": 20
}
}
},
{
"range": {
"ageMin": {
"lte": 28
}
}
},
{
"range":{
"activityDate":{
"gte":"2019-06-12T16:23:12.709Z"
}
}
},
{
"geo_distance":{
"distance":"50.0km",
"location.gps":{
"lon":-122.406417,
"lat":37.785834
}
}
}
],
"filter": {
"terms":
{
"category": ["Movies::Ballet"]
}
}
}
}
}
I expect to get back only the documents with category 'Movies::Ballet' but I get no hits..
I tried adding the "terms" query to the "must" array but same result.
I appreciate any help with figuring out where I am going wrong
I was finally able to get the query I want to work by changing 2 things:
Changed the category field for my test records to "Movies_Ballet" instead of "Movies::Ballet". I guess the "::" is a special character I was not aware of (someone please correct me if I am wrong here)
Changed the terms query to lowercase like:
"filter": {
"terms": {
"category": [
"movies_romance",
"TWO"
]
}
The expected result is returned.
hope this helps someone save some time

how to apply conditions on JSON response in Jmeter?

Response is as follows,
I have to extract all 'deviceResponseStatus.id' where status="PENDING"
how to implement it using JSON Path or REGEX in Jmeter?
{
"apiResponseStatus": "SUCCESS",
"deviceResponseList": [
{
"apiResponseStatus": "SUCCESS",
"id": 23,
"ownership": "CORPORATE",
"deviceName": "Demimbu",
"deviceType": "MOBILE",
"osType": "ANDROID",
"inTotalStorage": 0,
"inAvailableStorage": 0,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"osVersion": "4.2",
"buildVersion": "1.01.08",
"status": "PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"lastConnected": 1423810405000,
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"enrollmentDate": 1423790255000,
"simNumbers": [
"1236547896"
],
"imeiCodes": [],
"mobileNumbers": [
"4558585858858"
],
"createDate": 1421927250000,
"lastModified": 1423810406000,
"rooted": false,
"roaming": false,
"compliant": false
},
{
"apiResponseStatus": "SUCCESS",
"id": 24,
"ownership": "CORPORATE",
"deviceName": "Photobean",
"deviceType": "MOBILE",
"osType": "ANDROID",
"inTotalStorage": 20941258752,
"inAvailableStorage": 8024924160,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"bluetoothMacAddress": "8C:3A:E3:BE:C2:04",
"wirelessMacAddress": "8c:3a:e3:51:bb:e3",
"model": "LG-D686",
"osVersion": "4.4.2",
"buildVersion": "1.01.09",
"status": "PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"make": "LGE",
"lastConnected": 1423648831000,
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"enrollmentDate": 1423628675000,
"simNumbers": [
"404909008623970"
],
"imeiCodes": [
"359004053152889",
"359004053152871"
],
"mobileNumbers": [
"638847339387"
],
"createDate": 1422435029000,
"lastModified": 1423648831000,
"rooted": true,
"roaming": false,
"compliant": false
},
{
"apiResponseStatus": "SUCCESS",
"id": 25,
"ownership": "CORPORATE",
"deviceName": "Livetube",
"deviceType": "MOBILE",
"osType": "ANDROID",
"inTotalStorage": 0,
"inAvailableStorage": 0,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"osVersion": "4.2",
"buildVersion": "1.01.08",
"status": "APPROVAL_PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"lastConnected": 1423810522000,
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"enrollmentDate": 1423790371000,
"simNumbers": [
"1236547896"
],
"imeiCodes": [],
"mobileNumbers": [
"4558585858858"
],
"createDate": 1422435030000,
"lastModified": 1423810522000,
"rooted": false,
"roaming": false,
"compliant": false
},
{
"apiResponseStatus": "SUCCESS",
"id": 26,
"ownership": "CORPORATE",
"deviceName": "Riffwire",
"deviceType": "MOBILE",
"osType": "IOS",
"inTotalStorage": 0,
"inAvailableStorage": 0,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"status": "PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"simNumbers": [],
"imeiCodes": [],
"mobileNumbers": [],
"createDate": 1422435030000,
"lastModified": 1423216312000,
"rooted": false,
"roaming": false,
"compliant": false
},
Also, Please suggest any good option if any.
You question is JMeter specific, but i believe it's actually regular Json Path expression. For example, in SoapUI it could be done with
$.deviceResponseList[?(#.status=='PENDING')].id
Probably this could help in some way
JMeter provides JSON Path Extractor via JMeter Plugins Extras With Libs Set
I believe that this is the best way to accomplish your goal.
See Using the XPath Extractor in JMeter guide (scroll down to "Parsing JSON" chapter) for the plugin installation instructions and some sample JSON Path queries.

How do I format the API date fields in the template?

My routes look like this:
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.find('deliverySchedule');
}
});
My API payload returns deliverySchedules like this (see below).
{
"delivery_schedules": [
{
"id": 47,
"from": "0001-01-01T09:00:00.000Z",
"to": "0001-01-01T10:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.663Z",
"updated_at": "2015-01-12T16:17:05.663Z"
},
{
"id": 62,
"from": "0001-01-01T09:00:00.000Z",
"to": "0001-01-01T10:00:00.000Z",
"period": "tomorrow",
"status": "available",
"created_at": "2015-01-12T16:17:05.684Z",
"updated_at": "2015-01-12T16:17:05.684Z"
},
{
"id": 48,
"from": "0001-01-01T10:00:00.000Z",
"to": "0001-01-01T11:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.665Z",
"updated_at": "2015-01-12T16:17:05.665Z"
},
{
"id": 63,
"from": "0001-01-01T10:00:00.000Z",
"to": "0001-01-01T11:00:00.000Z",
"period": "tomorrow",
"status": "available",
"created_at": "2015-01-12T16:17:05.685Z",
"updated_at": "2015-01-12T16:17:05.685Z"
},
{
"id": 49,
"from": "0001-01-01T11:00:00.000Z",
"to": "0001-01-01T12:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.666Z",
"updated_at": "2015-01-12T16:17:05.666Z"
},
{
"id": 64,
"from": "0001-01-01T11:00:00.000Z",
"to": "0001-01-01T12:00:00.000Z",
"period": "tomorrow",
"status": "available",
"created_at": "2015-01-12T16:17:05.686Z",
"updated_at": "2015-01-12T16:17:05.686Z"
},
{
"id": 50,
"from": "0001-01-01T12:00:00.000Z",
"to": "0001-01-01T13:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.668Z",
"updated_at": "2015-01-12T16:17:05.668Z"
},
{
"id": 65,
"from": "0001-01-01T12:00:00.000Z",
"to": "0001-01-01T13:00:00.000Z",
"period": "tomorrow",
"status": "available",
"created_at": "2015-01-12T16:17:05.687Z",
"updated_at": "2015-01-12T16:17:05.687Z"
},
{
"id": 66,
"from": "0001-01-01T13:00:00.000Z",
"to": "0001-01-01T14:00:00.000Z",
"period": "tomorrow",
"status": "available",
"created_at": "2015-01-12T16:17:05.688Z",
"updated_at": "2015-01-12T16:17:05.688Z"
},
{
"id": 51,
"from": "0001-01-01T13:00:00.000Z",
"to": "0001-01-01T14:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.669Z",
"updated_at": "2015-01-12T16:17:05.669Z"
},
{
"id": 67,
"from": "0001-01-01T14:00:00.000Z",
"to": "0001-01-01T15:00:00.000Z",
"period": "tomorrow",
"status": "available",
"created_at": "2015-01-12T16:17:05.689Z",
"updated_at": "2015-01-12T16:17:05.689Z"
},
{
"id": 52,
"from": "0001-01-01T14:00:00.000Z",
"to": "0001-01-01T15:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.670Z",
"updated_at": "2015-01-12T16:17:05.670Z"
},
{
"id": 53,
"from": "0001-01-01T15:00:00.000Z",
"to": "0001-01-01T16:00:00.000Z",
"period": "today",
"status": "available",
"created_at": "2015-01-12T16:17:05.672Z",
"updated_at": "2015-01-12T16:17:05.672Z"
}
]
}
I have a template that looks like this:
<ul>
{{#each deliverySchedule in model}}
<li>
{{deliverySchedule.from}} - {{deliverySchedule.from}} ({{deliverySchedule.status}})
</li>
{{/each}}
</ul>
I want deliverySchedule.from and deliverySchedule.to to display something like: 1pm - 2pm (available). Right now it is displaying as:
Tue Jan 01 1901 17:00:00 GMT+0800 (SGT) - Tue Jan 01 1901 17:00:00 GMT+0800 (SGT) available
What is the right way to go about this? Should I turn the results of delivery_schedules into a new array in a controller and use something like moment.js to convert the from and to values to 1pm and 2pm formats respectively?
Apparently, I need to register the custom helper, following http://www.ember-cli.com/#resolving-handlebars-helpers
// app/helpers/convert-date-time.js
import Ember from "ember";
export default Ember.Handlebars.makeBoundHelper(function(value, options) {
var date = new Date(value);
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'pm' : 'am';
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
minutes = minutes < 10 ? '0'+minutes : minutes;
var strTime = hours + ':' + minutes + ' ' + ampm;
return strTime;
});
In a template:
{{convert-date-time deliverySchedule.from}}
You should use handelbar helpers in order to format your dates :)
Here is the documentation about it :
http://emberjs.com/guides/templates/writing-helpers/
You can use moment.js in your helper however depending on your needs it's may be over killing :)
In ember-cli use the command ember generate helper yourhelpername it will create a file in
app/helpers/ which looks like the following :
import Ember from 'ember';
function myhelper(value) {
//in your case format the date here ...for example ....
//you can also use moment.js and so on...
var toReturn=(new Date(value).getHours())+1;
if(toReturn >11){
toReturn=toReturn + " pm";
}else{
toReturn=toReturn + " am";
}
return toReturn;
}
export { myhelper };
export default Ember.Handlebars.makeBoundHelper(myhelper);
You then use {{myhelper deliverySchedule.from}}
you can also extend the helper by adding second parameters for options
import Ember from 'ember';
function myhelper(value,format) {
//in your case format the date here ...for example ....
//you can also use moment.js and so on...
var myDate=new Date(value);
var toReturn="";
switch(format){
case "dmy" :
toReturn=myDate.getDate()+" "+(myDate.getMonth()+1)+" "+myDate.getFullYear();
break;
case "ymd" :
toReturn=myDate.getFullYear()+" "+(myDate.getMonth()+1)+" "+myDate.getDate();
break;
default :
toReturn=(myDate.getMonth()+1)+" "+myDate.getDate();
break;
}
return toReturn;
}
export { myhelper };
export default Ember.Handlebars.makeBoundHelper(myhelper);
and in your template use
{{myhelper deliverySchedule.from "dmy"}}

Facebook graph API, access location tags in photos and posts

On photos and posts I often see location tags pointing to a Facebook page representing a place. They are typically prepended by "near" , "at" or "in". Does anybody know of a way to access this data via the graph API or any other way?
Here is an example :
webpage, I made the photo public so everyone can see http://www.facebook.com/photo.php?pid=11671735&id=506482094
api call https://graph.facebook.com/10150601497547095?access_token=*
{
"id": "10150601497547095",
"from": {
"name": "Edouard Tabet",
"id": "506482094"
},
"name": "Alcohol grows on trees in Isabela, Galapagos",
"picture": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg",
"source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg",
"height": 720,
"width": 479,
"images": [
{
"height": 2048,
"width": 1365,
"source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/329294_10150601497547095_506482094_11671735_110244218_o.jpg"
},
{
"height": 720,
"width": 479,
"source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg"
},
{
"height": 270,
"width": 180,
"source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_a.jpg"
},
{
"height": 130,
"width": 86,
"source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg"
},
{
"height": 112,
"width": 75,
"source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_t.jpg"
}
],
"link": "http://www.facebook.com/photo.php?pid=11671735&id=506482094",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"created_time": "2012-01-16T23:34:54+0000",
"position": 1,
"updated_time": "2012-01-21T02:16:55+0000",
"comments": {
"data": [
{
"id": "10150601497547095_7207114",
"from": {
"name": "Tom LeNoble",
"id": "218686"
},
"message": "hope you are having fun!",
"can_remove": true,
"created_time": "2012-01-16T23:36:33+0000"
},
{
"id": "10150601497547095_7207963",
"from": {
"name": "Sol McKinney",
"id": "1021642751"
},
"message": "How come Darwin didn't write about that?!",
"can_remove": true,
"created_time": "2012-01-17T01:31:39+0000"
},
{
"id": "10150601497547095_7212820",
"from": {
"name": "Romain BL",
"id": "556337447"
},
"message": "Des bisous mr Tabet! J'esp\u00e8re que tu vas bien depuis tout ce temps!",
"can_remove": true,
"created_time": "2012-01-17T18:19:13+0000"
}
],
"paging": {
"next": "https://graph.facebook.com/10150601497547095/comments?access_token="
}
},
"likes": {
"data": [
{
"id": "1404245",
"name": "Hannah Russin"
},
{
"id": "1278210658",
"name": "Seth Long"
},
{
"id": "218686",
"name": "Tom LeNoble"
}
],
"paging": {
"next": "https://graph.facebook.com/10150601497547095/likes?access_token=&limit=25&offset=25&__after_id=218686"
}
}
}
I figured it out... When accessing a photo with the "photo id" the place attribute is not present in the result... when accessing the same photo through its "post id" then the place attribute appears in the JSON result of the GRAPH API call. Not very convenient...
They should all have place:
https://developers.facebook.com/tools/explorer?method=GET&path=15500414_689594654776