Skip to main content
Solved

Filter by LastUpdatedTime while aggregating instances in API

  • December 20, 2024
  • 1 reply
  • 20 views

Forum|alt.badge.img

I am trying to get a count of all instances in a view that have been updated since a point in time. 

 

When using the /models/instances/list api call, I am able to filter LastUpdatedTime with 

    'filter': {

        'range': {

            'property': ['edge', 'lastUpdatedTime'],

            'gt' : '2007-01-01T00:00:00+00:00'

        }

 

However when I try to use this filter method in the /models/instances/aggregate api call, I am getting a 400 error. I have tried different permutations of what the correct property string lastUpdatedTime is without success. Any ideas?

 

I am able to filter by properties defined in the datamodel, but as I understand it LastUpdatedTime is not the same as a normal property

Best answer by Thomas Sjølshagen

AFIK, the lastUpdatedTime reflects the timestamp when _some_ property for the instance was changed, not specifically the instance itself. So it could be updated by an internal (hidden) property update from the service, or one of the user created properties. 

Basically, I don’t believe it’s a reliable filter target for you (and why we “hide” it). 

You could consider modeling your own property of its likeness (i.e. lastDataUpdateTime, or something), and then set it whenever the data it’s supposed to reflect is updated?

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img

AFIK, the lastUpdatedTime reflects the timestamp when _some_ property for the instance was changed, not specifically the instance itself. So it could be updated by an internal (hidden) property update from the service, or one of the user created properties. 

Basically, I don’t believe it’s a reliable filter target for you (and why we “hide” it). 

You could consider modeling your own property of its likeness (i.e. lastDataUpdateTime, or something), and then set it whenever the data it’s supposed to reflect is updated?


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings