2

I'm trying to access my back4app app mongodb directly from a python script:

client = pymongo.MongoClient("mongodb://admin:AAA@mongodb4.back4app.com:27017/BBB?ssl=true")

And I see that it connects but can't go further and figure out db name and collection names. Appreciate any help.

Dmitry Klimkin
  • 445
  • 3
  • 15
  • The same problem here. Sometimes it works, sometimes - doesn't. All the official documentation says is "You can connect to it at anytime using any MongoClient and make a dump of it and restore this dump wherever you want." -- and no information on how to actually do it. – Mike Ivanov Apr 03 '17 at 20:53
  • This might be related - http://stackoverflow.com/questions/31030307/why-is-pymongo-3-giving-serverselectiontimeouterror/31194981#31194981 – Mike Ivanov Apr 04 '17 at 23:18
  • 1
    Because of connect=False or not, it started working again. – Mike Ivanov Apr 04 '17 at 23:19

1 Answers1

2

The db name is "BBB"

In order to get the collections, try:

db = client['BBB']
cols = db.collection_names()
for col in cols:
  print col

Instead of accessing the database directly you can also try a python SDK (not official), like this: https://github.com/milesrichardson/ParsePy

Davi Macêdo
  • 2,954
  • 1
  • 8
  • 11