Place holders are not allowed in ORDER BY expression, direction, nulls placement.
If one used ORDER BY $1 DESC. Place holders are constants. This becomes ORDER BY constant DESC. This NO OP because ORDER BY constant across results (duplicates).
These are needed for Optimizer plan purpose, use index order.
Indirectly we allow dynamic fields in ORDER BY fields (i.e. can be place holders). In that case no index order will be used, covering is not possible (i.e. all index pushdowns are off).
FROM default AS d
ORDER BY d.[$1] DESC NULLS LAST OFFSET $2 LIMIT $3;
$1 must be string of field in the document, if not string it raises error.
Is it possible DESC, ASC, NULLS LAST|FIRST (at least ASC, DESC) can be place holders. These can't use index order, Optimizer really doesn't depend on these values.
FYI: How Dynamic fields works? ex : d.[d.b]
Normally ORDER BY you need sort same fields across query results. you can use named/query parameter as dynamic field.