Question of :filter operator and sort

79 views
Skip to first unread message

Mohammad Rahmani

unread,
May 18, 2021, 8:04:25 AM5/18/21
to tiddl...@googlegroups.com
I use a :filter to sort tiddlers based on the values in their fd field

<$list filter="[tag[fsort]] :filter[get[fd]nsort[fd]]">

</$list>


This does not work! Why?

Reproduce
1. drag and drop attached json to https://tiddlywiki.com/prerelease/
2. open the Test of :filter




Best wishes
Mohammad
filter-sort.json

Mohammad Rahmani

unread,
May 18, 2021, 8:07:15 AM5/18/21
to tiddl...@googlegroups.com
I know my question has the below answer

<$list filter="[tag[fsort]sort[fd]]">

</$list>


But I am working on :filter and I want to know how it works in different situation!


Best wishes
Mohammad

Mohammad Rahmani

unread,
May 18, 2021, 8:10:14 AM5/18/21
to tiddl...@googlegroups.com

The filter operator runs a subfilter for each input title, and returns those input titles for which the subfilter returns a non-empty result (in other words the result is not an empty list). The results of the subfilter are thrown away.

Does this mean results are returned one by one and we cannot do an operation like sort?


Best wishes
Mohammad


On Tue, May 18, 2021 at 4:34 PM Mohammad Rahmani <mohammad...@gmail.com> wrote:

Saq Imtiaz

unread,
May 18, 2021, 8:15:48 AM5/18/21
to TiddlyWiki
 
Does this mean results are returned one by one and we cannot do an operation like sort?


Yes,correct. For sorting from 5.1.24 you can use :sort
 

Mohammad Rahmani

unread,
May 18, 2021, 8:21:52 AM5/18/21
to tiddl...@googlegroups.com
Saq,
 Thanks a million!

I need to practice more with :filter and learn!

Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5c3f5c88-c387-4680-b7fd-4357f6e210f2n%40googlegroups.com.

Saq Imtiaz

unread,
May 18, 2021, 8:23:37 AM5/18/21
to TiddlyWiki
The simplest way to look at :filter is that it removes the input titles for which the :filter run returns no result.

That is all that it does. 

Mohammad Rahmani

unread,
May 18, 2021, 9:23:41 AM5/18/21
to tiddl...@googlegroups.com
On Tue, May 18, 2021 at 4:53 PM Saq Imtiaz <saq.i...@gmail.com> wrote:
The simplest way to look at :filter is that it removes the input titles for which the :filter run returns no result.

That is all that it does. 

I got it! Much appreciated!
 Actually it is very semantic :filter those do not meet the criteria given inside the :filter[]

I will document this!

On Tuesday, May 18, 2021 at 2:21:52 PM UTC+2 Mohammad wrote:
Saq,
 Thanks a million!

I need to practice more with :filter and learn!

Best wishes
Mohammad


On Tue, May 18, 2021 at 4:45 PM Saq Imtiaz <saq.i...@gmail.com> wrote:
 
Does this mean results are returned one by one and we cannot do an operation like sort?


Yes,correct. For sorting from 5.1.24 you can use :sort
 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5c3f5c88-c387-4680-b7fd-4357f6e210f2n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Saq Imtiaz

unread,
May 18, 2021, 9:34:43 AM5/18/21
to TiddlyWiki
@Mohammad if you feel we could rephrase the documentation to make this clearer, please do make a PR.

Mohammad Rahmani

unread,
May 18, 2021, 10:17:15 AM5/18/21
to tiddl...@googlegroups.com
Hi Saq,

On Tue, May 18, 2021 at 6:04 PM Saq Imtiaz <saq.i...@gmail.com> wrote:
@Mohammad if you feel we could rephrase the documentation to make this clearer, please do make a PR.

I am experimenting with some new filter operators and I would absolutely be happy to help here!
Reply all
Reply to author
Forward
0 new messages