Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search in history of a thing using RQL filter #1583

Closed
thjaeckle opened this issue Feb 23, 2023 · 0 comments · Fixed by #1815
Closed

Search in history of a thing using RQL filter #1583

thjaeckle opened this issue Feb 23, 2023 · 0 comments · Fixed by #1815
Assignees
Milestone

Comments

@thjaeckle
Copy link
Member

thjaeckle commented Feb 23, 2023

With the addition of #1498 (to be released in Ditto 3.2.0), it is possible to get a stream of all modification events of a thing (up to the configured history-retention-duration (e.g. 30 days).

It would be quite easy to enhance this new API in order to find a "special condition" within the history of a thing.
Examples:

  • stream all events matching a given condition (filter as RQL)
    • e.g. in which a specific property was modified (via the SSE API):
      /api/2/things/namespace:my-thing1?from-historical-revision=1&filter=exists(feature/myFeature/properties/targetProperty)

Additional idea (optional):

  • return the state of a twin when a certain condition (filter as RQL) matched
    • e.g. get state of complete twin when a given threshold was "first" reached:
      GET /api/2/things/namespace:my-thing1?filter-first-historical-revision=gt(feature/myFeature/properties/value,42)
    • e.g. get state of complete twin when a given threshold was "last" reached:
      GET /api/2/things/namespace:my-thing1?filter-last-historical-revision=gt(feature/myFeature/properties/value,42)
    • e.g. get timestamp when a given property was "last" modified:
      GET /api/2/things/namespace:my-thing1?filter-last-historical-revision=exists(feature/myFeature/properties/value)&fields=_revision,_modified
@thjaeckle thjaeckle added this to the 3.3.0 milestone Mar 31, 2023
@thjaeckle thjaeckle modified the milestones: 3.3.0, 3.4.0 Jun 16, 2023
@thjaeckle thjaeckle removed this from the 3.4.0 milestone Aug 25, 2023
thjaeckle added a commit that referenced this issue Nov 23, 2023
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Nov 25, 2023
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
@thjaeckle thjaeckle added this to the 3.5.0 milestone Dec 17, 2023
thjaeckle added a commit that referenced this issue Dec 19, 2023
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
@thjaeckle thjaeckle self-assigned this Dec 19, 2023
thjaeckle added a commit that referenced this issue Jan 4, 2024
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Jan 4, 2024
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Jan 5, 2024
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Jan 5, 2024
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Jan 8, 2024
…-in-historical-events

#1583 apply RQL based filtering when streaming "historical" thing events
thfries pushed a commit to thfries/ditto that referenced this issue Jan 13, 2024
…al" thing events

Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thfries pushed a commit to thfries/ditto that referenced this issue Jan 13, 2024
… thing events

Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant