Skip to content

Instantly share code, notes, and snippets.

@puckipedia
Created November 24, 2017 10:36
Show Gist options
  • Save puckipedia/fa6cccd270396d00055dde3e960c5a68 to your computer and use it in GitHub Desktop.
Save puckipedia/fa6cccd270396d00055dde3e960c5a68 to your computer and use it in GitHub Desktop.
// filter:negate:
// negates the filter it's contained in
// filter:any:
// true iff, for every predicate in the filter, the object to filter contains at least one of the values OR one of the embedded filters apply
// filter:all:
// true iff, for every predicate in the filter, the object to filter contains all the values AND all of the embedded filters apply
e.g. all activities by me or my alt
{
"type": "filter:CollectionFilter",
"filter:filterOn": { "_": "should contain exactly one filter type",
"_": "(actor contains https://puckipedia.com OR actor contains https://puckipedia.com/alt)",
"filter:any": { "actor": ["https://puckipedia.com", "https://puckipedia.com/alt"] },
}
}
e.g. all announces that are public (type contains Announce and (to contains as:Public OR cc contains as:Public)
{
"filter:all": {
"type": "Announce",
"filter:any": [
{ "to": "as:Public" },
{ "cc": "as:Public" }
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment