session.getOptions is not a function

Hello Guys,

I am using Mongo 4.0 along with nodejs in my project. and I want to use MongoDB transactions to execute multiple commands. and I want to set writeConcern in my session for transactions query. and writeConcern will be:

"writeConcern" : {
            "w" : 1

So how I set this in my Session object.

I am using the following code

    let session = await adaptor.startSession({});
console.log("session option",session.getOptions())

but it giving me error like :

`session.getOptions is not a function

SO how I can set writeConcern in my session and what is this error?

Can you please help me here