as, to do as~
Expresses doing something exactly as a condition or state dictates, often 'as one is told' or 'as it stands'.
This pattern indicates that an action is done in accordance with something else, such as a person's words, a desire, or a state. It often translates as 'as (someone) says' or 'as it is'. For example, 言うままに means 'as one says', and 思うままに means 'as one thinks' or 'freely'.
It can also be used with an actual state or condition that is left unchanged, like 自然のままに (as nature is) or そのままに (as it is). In such cases, it often means 'to leave something as is'.
This pattern is somewhat formal and is often found in written narratives or set phrases. In casual speech, you might use とおりに or ように instead. For instance, 言うとおりに is more common in conversation.