Can we use Mongodb Compass

Hi ,
I am using the link "mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017 etc…” to connect to mongo shell, Can we have a link to connect with Mongodb Compass.

Thnx

Hi,

Sure! Try like this:

Please note that you must have Mongo DB Compass 1.14 or later to support aggregation queries.

José Carlos

3 Likes

Thank You.
its works great
:smile:

You are welcome!

José Carlos

i could use : {$regex: /^Won.*Oscars?/}, but i hardly struggle with all / and \ options for hours doing /Won/s+/d+/s/ … and i got no where

Hi,

The regular expression can be easier if you use meta-characters, e.g. \d{1, 2} would match numbers of 1 and 2 digits.

Hope this helps.

José Carlos

well it wouldn’t accept that \d or \s…

Hi,

Please try like this:

{$match: {awards: /your regular expression/}}

I just checked my regular expression (which indeed uses the metacharacter \d{1,2}) and worked as expected.

José Carlos

Hi. I’m having authentication fail when trying to connect with Compass. Any suggestion?

Edit: Now I get the following error

An error occurred while loading navigation: there are no users authenticated

And it seems I am inside the database, but I can see the name of collections from previous M001 course also, but when I click on any collection I can not see anything

Edit 2: Nevermind restart Compass app and everything solve. Thanks

Glad you managed it to work!

could you please share username and password to connect using compass.

thanks.

Sure! You can use Compass. The username and password are in the connection string. The username is m121 and the password is aggregations.

José Carlos

2 Likes

Is there a Compass for Windows or a Linux Server or is this a Mac only MongoDB course? I’m running Win 10 and a Ubuntu (16) VM

Hi,

Yes, Compass is available for Windows, MacOS and some Linux distributions (RedHat and Ubuntu. Please note that it would likely work on any other distributions based on RedHat or Debian/Ubuntu). I’m using Compass on Fedora Core and it works like a charm.

You can download it from:

https://www.mongodb.com/download-center/compass

José Carlos

I’m an idiot…I didn’t notice they were dropdowns :confused:

I feel stupid.

Thanks

Hi, can you please help me connect using the following.
mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

It shows the following error:
2019-01-12T19:14:13.940+0530 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:6