title: Query Expression role: manual tags: #manual #search #zettelstore syntax: zmk back: 00001006020000 00001007000000 00001007031100 00001007031140 00001007040310 00001010070200 00001012051200 00001012051400 00001012931600 backward: 00001006020000 00001007000000 00001007031100 00001007031140 00001007040310 00001007702000 00001007790000 00001010070200 00001012051200 00001012051400 00001012931600 box-number: 1 copyright: (c) 2020-present by Detlef Stern created: 20220805150154 forward: 00001006050000 00001007701000 00001007702000 00001007705000 00001007706000 00001007710000 00001007720000 00001007720300 00001007720600 00001007720900 00001007721200 00001007770000 00001007780000 00001007790000 lang: en license: EUPL-1.2-or-later modified: 20230731161954 published: 20230731161954 visibility: public A query expression allows you to search for specific zettel and to perform some actions on them. You may select zettel based on a list of [[zettel identifier|00001006050000]], based on a query directive, based on a full-text search, based on specific metadata values, or some or all of them. A query expression consists of an optional __[[zettel identifier list|00001007710000]]__, zero or more __[[query directives|00001007720000]]__, an optional __[[search expression|00001007701000]]__, and an optional __[[action list|00001007770000]]__. The latter two are separated by a vertical bar character (""''|''"", U+007C). A query expression follows a [[formal syntax|00001007780000]]. * [[List of zettel identifier|00001007710000]] * [[Query directives|00001007720000]] ** [[Context directive|00001007720300]] ** [[Ident directive|00001007720600]] ** [[Items directive|00001007720900]] ** [[Unlinked directive|00001007721200]] * [[Search expression|00001007701000]] ** [[Search term|00001007702000]] ** [[Search operator|00001007705000]] ** [[Search value|00001007706000]] * [[Action list|00001007770000]] Here are [[some examples|00001007790000]], which can be used to manage a Zettelstore: |=Query Expression|=Meaning |[[role:configuration|query:role:configuration]]|Zettel that contains some configuration data for the Zettelstore |[[ORDER REVERSE created LIMIT 40|query:ORDER REVERSE created LIMIT 40]]|40 recently created zettel |[[ORDER REVERSE published LIMIT 40|query:ORDER REVERSE published LIMIT 40]]|40 recently updated zettel |[[PICK 40|query:PICK 40]]|40 random zettel, ordered by zettel identifier |[[dead?|query:dead?]]|Zettel with invalid / dead links |[[backward!? precursor!?|query:backward!? precursor!?]]|Zettel that are not referenced by other zettel |[[tags!?|query:tags!?]]|Zettel without tags |[[expire? ORDER expire|query:expire? ORDER expire]]|Zettel with an expire date, ordered from the nearest to the latest |[[00001007700000 CONTEXT|query:00001007700000 CONTEXT]]|Zettel within the context of the [[given zettel|00001007700000]] |[[PICK 1 | REDIRECT|query:PICK 1 | REDIRECT]]|Redirect to a random zettel