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

Extension: DELETE on collection, with $filter #44

Open
hylkevds opened this issue Mar 20, 2018 · 3 comments
Open

Extension: DELETE on collection, with $filter #44

hylkevds opened this issue Mar 20, 2018 · 3 comments
Labels
extension This should be discussed as an extension to the document. tbd to be discussed

Comments

@hylkevds
Copy link
Contributor

Data cleanup with the SensorThings API is currently very inconvenient. If you want to regularly delete all Observations older than 3 years, you have to first GET all those observations' ids, and then DELETE each Observation separately. You can do it in one Request using batch, but you still have to list each DELETE command.

I would suggest extending DELETE to also work on collections, and allow $filter to state which entities should be deleted.

Deleting all Observations older than 3 years could be as simple as:

DELETE v1.0/Observations?$filter=phenomenonTime lt now() sub duration'P3Y'
@chhonker
Copy link

Is this functionality available in FROST-Server ?

@hylkevds
Copy link
Contributor Author

Not yet, it's on our TODO list.

@hylkevds
Copy link
Contributor Author

The changes mentioned in #3 also add delete notification to the standard. It's probably a good idea to allow a server to not send notifications for items deleted using a filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension This should be discussed as an extension to the document. tbd to be discussed
Projects
None yet
Development

No branches or pull requests

3 participants