Equivalen to set echo on

Is there any way to show the js script that i am executing as in sql with set echo on?

if thre is an error as oracle shows them?
some exmples in sql are as follows

SQL> ALTER TABLE TABLE_NAME ADD column_name VARCHAR2(1) DEFAULT ‘N’ NOT NULL;
table modified
Transcurrido: 00:00:00.10

SQL> update TABLE set ROAMING_ZONE = 2 where subid = 73009 and service_provider_id = ‘adfdfdfd’;

1 row updated.

Hi @ramis_sulpya,

YES!! We can get messages of the operations that we perform in MongoDB.
Please check the screenshot below:

I hope this is what you wanted to know.
Please let me know, if you have any questions.

Thanks,
Sonali

@Sonali_Mamgain thanks a lot.
the things is that we execute scripts as desdcribed below:

mongo ip:27017 --verbose --authenticationDatabase admin -u user_name -p password script.js 2>&1 >> file.log

the script is a kind of
db = db.getSiblingDB(‘xxx’);
db.collection.createIndex({name : 1}, {unique : 1, name : “index_name” });
db.collection.createIndex({customer_ids : 1}, {unique : 1, name : “index_name_1” });


and i get the output

MongoDB shell version v3.6.10
connecting to: mongodb://localhost:27017/test?authSource=admin&gssapiServiceName=mongodb
2019-06-21T12:43:58.090+0000 D NETWORK [thread1] creating new connection to:localhost:27017
2019-06-21T12:43:58.090+0000 D NETWORK [thread1] connected to server localhost:27017 (127.0.0.1)
2019-06-21T12:43:58.091+0000 D NETWORK [thread1] connected connection!
Implicit session: session { “id” : UUID(“0023afbe-ddf5-4b0c-a960-76f3884851cf”) }

What do i need so that i get the output where what is executed and the result?

Ramis