Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How to retrieve daml contracts from fabric ledger, according to time?Forum ↗

How to retrieve daml contracts from fabric ledger, according to time?

App Development2 posts190 views2 likesLast activity May 2021
EN
Enthusiast-BlockOP
May 2021 1

I want to fetch daml contracts that I stored in ledger according to Time (Data Type in DAML).

Ex :-
This is how, the query looks when I am creating my contract :-

{
    "templateId": "Example",
    "payload": {
        "updatedDate": "2015-12-05T11:15:31Z"
    }
}


For retrieving, my query is ;- 

{
    "templateIds": [
        "Example"
    ],
    "query": {

    }
}

In this was it return all the contracts, with the first one being the contract, that is created earlier according to time…

How should I retrieve in a way where the contract I have created latest, should come first?

ST
stefanobaghino-da
May 2021 1

The HTTP JSON API query language does not implement ordering at the moment, you would have to fetch the active contracts and sort them on your end before serving them.

← Back to Discussions