Skip to content

Instantly share code, notes, and snippets.

@mjumbewu
Created September 9, 2014 15:51
Show Gist options
  • Save mjumbewu/71a95ca669a7dd1f87ec to your computer and use it in GitHub Desktop.
Save mjumbewu/71a95ca669a7dd1f87ec to your computer and use it in GitHub Desktop.
Filter both places and comments by properties on the places
{{#created_within_days 365 dataset.places}}
{{!-- Filter the places by some property --}}
{{#filter_by . "properties.location_type" "park"}}
Number of new places: {{length .}}
{{#each .}} ... {{/each}}
{{/filter_by}}
{{/created_within_days}}
{{!-- ============================================================ --}}
{{#created_within_days 365 dataset.submission_sets.comments}}
{{!-- Attach the full place data to each comment --}}
{{#annotate_with_places .}}
{{!-- filter the comments by some property of their attached place --}}
{{#filter_by . "place.properties.location_type" "park"}}
Number of new comments: {{length .}}
{{#each .}} ... {{/each}}
{{/filter_by}}
{{/annotate_with_places}}
{{/created_within_days}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment