Discussion:
Connection error : MongoDB Shell to MongoDB Atlas
(too old to reply)
RAJ SINGH
2018-05-26 14:08:10 UTC
Permalink
Hi,

I have been trying to connect mongoDB shell from my local system to below
cluster used for mongoDB class on EDX portal :

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/100YWeatherSmall?replicaSet=cluster0-shard-0"
--authenticationDatabase admin --ssl --username m001-student --password
m001-mongodb-basics

Getting below error every time :

*2018-05-26T19:22:05.396+0530 E QUERY [thread1] SyntaxError: missing ;
before statement @(shell):1:6 *

I am able to connect successfully with Atlas cluster via mongoDB compass
from my system but shell connection has failed.

MongoDB version installed : 3.6
MongoDB Shell version : 3.6.5

Tried searching but was not able to resolve problem. Please could you help .

Thanks
raj
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/5ccde54e-1f46-4d64-8cc2-d12b162ffcc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
RAJ SINGH
2018-05-28 08:17:49 UTC
Permalink
Hi,

Please can anyone help me out.

thanks
Raj
Post by RAJ SINGH
Hi,
I have been trying to connect mongoDB shell from my local system to below
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/100YWeatherSmall?replicaSet=cluster0-shard-0"
--authenticationDatabase admin --ssl --username m001-student --password
m001-mongodb-basics
*2018-05-26T19:22:05.396+0530 E QUERY [thread1] SyntaxError: missing ;
I am able to connect successfully with Atlas cluster via mongoDB compass
from my system but shell connection has failed.
MongoDB version installed : 3.6
MongoDB Shell version : 3.6.5
Tried searching but was not able to resolve problem. Please could you help .
Thanks
raj
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/23762f6e-99e1-4d40-9fef-61db0aabf51e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Kevin Adistambha' via mongodb-user
2018-05-30 00:58:38 UTC
Permalink
Hi Raj

2018-05-26T19:22:05.396+0530 E QUERY [thread1] SyntaxError: missing ;
before statement @(shell):1:6

Could you run the mongo shell command using the --norc parameter?

If you can connect without any issue, you may want to take a look at your
~/.mongorc.js (in Unix systems) file and check it for errors — a missing
semicolon from the error message. See the mongorc.js page
<https://docs.mongodb.com/manual/mongo/#mongorc-js-file> for more
information.

If you still having errors, please post the complete shell output you’re
seeing from mongo invocation up to the error.

Best regards
Kevin
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/392e4171-349d-4478-8787-30231caa4266%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
RAJ SINGH
2018-05-30 15:15:04 UTC
Permalink
Hi Kevin,

Thanks for responding mate. I did try what you mentioned but that did not
help me. Please find attached snapshots for your reference.

I have mongoDB 3.6.5 2008R2Plus Enterprise (64 Bit) and MongoDB Compass
installed on my system as suggested in MongoDB basics class. Interesting
part is i am able to connect to both Altas clusters [ one cluster shared in
mongoDB class and second one which i created online via mongoDB portal ]
via compass installed on my system.

thanks
Raj
Post by 'Kevin Adistambha' via mongodb-user
Hi Raj
2018-05-26T19:22:05.396+0530 E QUERY [thread1] SyntaxError: missing ;
Could you run the mongo shell command using the --norc parameter?
If you can connect without any issue, you may want to take a look at your
~/.mongorc.js (in Unix systems) file and check it for errors — a missing
semicolon from the error message. See the mongorc.js page
<https://docs.mongodb.com/manual/mongo/#mongorc-js-file> for more
information.
If you still having errors, please post the complete shell output you’re
seeing from mongo invocation up to the error.
Best regards
Kevin
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/23341ed8-a88d-4119-8a86-c78f5f2a0817%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yogesh Irmal
2018-12-10 15:58:48 UTC
Permalink
Hello Raj,

Did you get any solution?
I am facing the same issue, not able to find any help on google.

Best Regards,
Yogesh Irmal
Post by RAJ SINGH
Hi Kevin,
Thanks for responding mate. I did try what you mentioned but that did not
help me. Please find attached snapshots for your reference.
I have mongoDB 3.6.5 2008R2Plus Enterprise (64 Bit) and MongoDB Compass
installed on my system as suggested in MongoDB basics class. Interesting
part is i am able to connect to both Altas clusters [ one cluster shared in
mongoDB class and second one which i created online via mongoDB portal ]
via compass installed on my system.
thanks
Raj
Post by 'Kevin Adistambha' via mongodb-user
Hi Raj
2018-05-26T19:22:05.396+0530 E QUERY [thread1] SyntaxError: missing ;
Could you run the mongo shell command using the --norc parameter?
If you can connect without any issue, you may want to take a look at your
~/.mongorc.js (in Unix systems) file and check it for errors — a missing
semicolon from the error message. See the mongorc.js page
<https://docs.mongodb.com/manual/mongo/#mongorc-js-file> for more
information.
If you still having errors, please post the complete shell output you’re
seeing from mongo invocation up to the error.
Best regards
Kevin
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/a7bd7cb3-7b57-436f-ad9e-ba4bc10956ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Kevin Adistambha' via mongodb-user
2018-06-01 00:28:12 UTC
Permalink
Hi Raj

The mongo shell is a Javascript interpreter. Trying to type mongo <server
address> <additional parameters> inside the shell is a syntax error (it is
not a Javascript statement or any supported command). This is the source of
the SyntaxError: missing ; before statement output.

There are more details in the mongo shell page
<https://docs.mongodb.com/manual/mongo/> regarding the shell.

To connect to your Atlas instance, you should type at the command prompt:

C:\Users\user> mongo "mongodb://<your Atlas deployment address>" --ssl --authenticationDatabase admin --username <your username> --password <PASSWORD>

I would also recommend you to peruse the free courses at the MongoDB
University <https://university.mongodb.com/>, e.g. M001
<https://university.mongodb.com/courses/M001/about> which is a thorough
introduction to MongoDB. The next session will start at 5 June.

Best regards
Kevin
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/34cf608f-f15a-40d7-8fa3-c019563f5a70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...