How to set active document

I am trying to set the active document using _id as stated here.

When I try:

const { app, core, action } = require("photoshop");
await app.activeDocument(myDoc._id);

I get:
“TypeError: app.activeDocument is not a function”

How should I select the active document?

According to docs, you should provide the document itself and updated 2022 docs say it’s a property:

app.activeDocument = myDoc;