This is possible using the @eq
helper:
{#projects}
{@eq key=name value="B"}
My name is {name} and my amount is {amount}.
{/eq}
{/projects}
This template will loop through each of the project items, but it will only print out:
My name is B and my amount is 20.
For this to work, you must have both dustjs and dustjs-helpers available.