Skip to content

Marshall

My feedback

1 result found

  1. 1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Marshall commented  · 

    Massimillano;

    That is more or less what I do now. It's a bit cumbersome since everything is wrapped in bash. I'm not sure how option 2 would work. I'll have to investigate and see how I could make that work.

    Everything I'm doing currently has some kind of bash front end that calls some large JS script where parameters are supplied from the command line.

    Regards

    An error occurred while saving the comment
    Marshall commented  · 

    Wernfried:

    I'm running with MongoDB 6.0 and mongosh 1.6.0 and this worked for me.

    echo "db.getMongo();"|mongosh --quiet "mongodb://user:password@localhost/MHDB?authSource=admin"

    MYDB> db.getMongo();
    mongodb://<credentials>@localhost/MYDB?authSource=admin&directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.0

    I can also get it to work as a "here" document. Example:
    mongosh --quiet "mongodb://user:password@localhost/MHDB?authSource=admin" <<EOJS
    use MYDB
    db.getMongo()
    EOJS

    MYDB> db.getMongo();
    mongodb://<credentials>@localhost/MYDB?authSource=admin&directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.0

    Marshall shared this idea  · 

Feedback and Knowledge Base