Hi Friends,
My use case is bit complex…
This is my document.
[
{
“data”: {
“createdAt”: “2022-09-22T02:22:45.019433899Z”,
“createdBy”: “trn:tedasdasdsadWEWEWDDSdasfdaf4”,
“events”: [
{
“authorisedId”: “tsdfsadgfgfsdgdfhghfghewgregvg76”,
“customerId”: “tsdjvhdsjkalhvnlksdanvjhssgkhcakjfhkja54”,
“dateTime”: “2020-09-07T08:45:45.993Z”,
“id”: “tsdfsadgfgfsdgdfhghfghewgregvg76efawe”,
“locationId”: “tsdfsadgfgfsdgdfhgfewerhfghefwgregvg76”,
“type”: “Credited”,
“validFrom”: “2020-09-07T08:45:45.993Z”,
“value”: 3
},
{
“authorisedId”: “dsrgrgrvwerf”,
“customerId”: “dsafefwefwwefwefwef”,
“dateTime”: “2022-04-15T01:41:05.807402585Z”,
“eventDescription”: {
“language”: “en-GB”,
“text”: “Cjdgfhfgdhgfh8”
},
“funder”: “hfgdhfghfdhd”,
“id”: “TBANKCC.202204110000.4076.01910.000000863.334197”,
“type”: “Credited”,
“validFrom”: “2022-04-15T01:41:05.807402585Z”,
“value”: 16
},
{
“authorisedId”: “tsdfsadgfgfsdgdfhghfgxzxzhewgregvg76”,
“customerId”: “tsdfsadgfgfsdgdfhghfgdwefddfdsahewgregvg76”,
“dateTime”: “2021-07-22T10:50:37.152Z”,
“id”: “abdc1bec-29b4-4215-90fc-30a1b694f6ed”,
“locationId”: “tadsascascA7”,
“type”: “Credited”,
“validFrom”: “2021-07-22T10:50:37.152Z”,
“value”: 30
},
{
“authorisedId”: “tsdfsadgfgfsdgdfhghfedassaffghewgregvg76”,
“customerId”: “tsdfsadgfgfsdgdfaesdffhghfghewgregvg76”,
“dateTime”: “2021-05-15T01:24:31.964Z”,
“eventDescription”: {
“language”: “en-GB”,
“text”: “CscADCADSSVD”
},
“funder”: “TBadfadfD”,
“id”: “TFEAWDCDSCsc01”,
“type”: “Credited”,
“validFrom”: “2021-05-15T01:24:31.964Z”,
“value”: 15
},
“id”: “Temp:0000088a-ea4d-4e4f-b61d-747e368b1fbd:1”,
“schemaVersion”: “2022-09-22”,
“schemeId”: “Temp”,
“snapshots”: ,
“type”: “group-txn-archive”
}
}
]
Here, the events are the array fileds, in which “dateTime” is one among them…
I would want to know, if there is any possibility to create a dataset on analytics, by flattening the date field…
The current problem I see is, because of the large number of arrays on a single document, the ingestion is taking lot of time. Also, having an array index to process the query is very hard and is taking lots of time.
So I was looking for a possibility to see, if the array can be flattened in the create collection itself, so that, the array will be distributed as a flat files in the collections, so it will be easier to query.
I tried a lot, But Any expertise, who could help on this would be much thankful.
Something like, create collection flatten keys or something…
Thanks