No activity today, make something!
tweb-filters select

20161127103759 cdent  

A select filter includes an entity in the results if an attribute on that entity matches the value or condition given in the select command. A simple select filter looks like this:

    select=title:monkey

This would select all entities with a title of monkey. title is the attribute, monkey is the value or condition.

The condition can be negated with a ! prefix:

    select=title:!monkey

That selects all entities with a title that is not monkey.

The condition can also select in a greater than or less than manner (sorts on strings are normalized to lowercase):

    select=title:<b

The results of this would be anything with a title starting with "a".

When the attribute in question is a known timestamp (such as modified on a tiddler) partial timestamp strings are filled in. That is: if you give 20110101 then the time is extrapolated to 2011010100000000 (exactly midnight on the first day of 2011). This is useful when doing sorted selects:

    select=modified:>201102

gets everything modified since the start of February in 2011.

Custom fields on tiddlers are treated as any other attribute.

It is possible to create virtual attributes via plugins, which encapsulate some logic. See Extending Filters.

There are (at the time of this writing) four existing virtual attributes built into the TiddlyWeb code:

  • tag: entity has tag named as the value
  • text: the text given as the value is in the text attribute (sort of like a grep of the text)
  • field: the entity has the field named in the value, no matter what the value of the field
  • rbag: the entity is a recipe and the recipe list contains the bag named in the value