How to do "where contains" in javascript

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I want to display all of my notes that contain “flashcard” in the tag.

I’m creating a dashboard that has a bit of javascript in it and I don’t know javascript at all.

I searched for “where contains javascript”

This is what I’m working with:

$=dv.list(dv.pages('#flashcard').sort(f=>f.file.name,"desc").limit(20).file.link)

I just don’t understand how to tell it to pull tags that contain “flashcard”.

1 Like

How many flashcard tags do you have? If it’s a fixed, known amount, it would be better for performance to specify them by name. (#flashcard1 OR #flashcard2 OR ...)

But if you want to:

dv.pages().where(page => page.file.tags.some(tag => tag.includes('flashcard'))))
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.