Reputation: 251
{
"name": "ruby",
"phone": [
{
"type": "mobile",
"number": 12345678
},
{
"type": "office",
"number": 2433242
}
]
}
My problem here is, I just want to sort the documents like the one mentioned above based on the size of phone array.
Upvotes: 1
Views: 47
Reputation: 66723
You could create a Template Driven Extraction (TDE) with a column that has the size of the phone array, and then search and sort with the Optic API.
Unfortunately, you cannot simply create a path-range-index with the following XPath, because it isn't an indexable XPath expression:
/array-node('phone')/count(node())
Upvotes: 1