TV values are not stored in the DB table that has the resources, so it's a little trickier.
If the TV is never set to its default value, and doesn't require processing (i.e. it's a regular text TV), and you know that there's only one resource with that TV value, this will be a very fast efficient way to get the resource (replace 12 with the ID of the TV).
$tvId = 12;
$tvValue = 'some value';
/* Get the resource ID from the modTemplateVarResource */
$query = $modx->newQuery('modTemplateVarResource', array(
'value' => $tvValue,
'tmplvarid' => $tvId,
));
$query->select('contentid');
$DocId = $modx->getValue($query->prepare());
BTW, TVs are not a very good place to store resource selection criteria because of the way they're stored. If there is an unused resource field (introtext, description, menutitle), it will be a lot faster and easier to put the data there.
If you are using multiple TVs this way, you might be better off extending the modResource object with ClassExtender to add your extra fields (which could then be shown as regular resource fields on the Create/Edit Resource panel).