Python Forum
how to get the list of databases to a variable using pymongo?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get the list of databases to a variable using pymongo?
#1
I'm pretty new to python programming & mongo aswell...how can i get the list of databases from a mongo instance into a variable using pymongo? 

thank you.
Reply
#2
After you have a connection, use connection.database_names:

https://api.mongodb.com/python/current/a...base_names
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting error when running "MINUS" between 2 databases marlonbown 4 1,260 Nov-10-2022, 05:49 AM
Last Post: deanhystad
  websockets and pymongo exception sankar2000 0 993 Oct-07-2022, 09:52 PM
Last Post: sankar2000
  PyMongo error bagou450 0 798 Aug-04-2022, 08:27 AM
Last Post: bagou450
  [Solved]Help comparing 2 databases Extra 2 1,113 Jul-15-2022, 11:12 PM
Last Post: Extra
  Split string using variable found in a list japo85 2 1,295 Jul-11-2022, 08:52 AM
Last Post: japo85
Exclamation MongoDB cannot connect - pymongo speedev 1 2,085 Aug-21-2021, 01:35 PM
Last Post: ndc85430
  An IF statement with a List variable dedesssse 3 8,210 Jul-08-2021, 05:58 PM
Last Post: perfringo
  pymongo wildcard query issue MikeAW2010 2 4,258 Jul-06-2021, 09:25 AM
Last Post: swag
  Create variable and list dynamically quest_ 12 4,392 Jan-26-2021, 07:14 PM
Last Post: quest_
Question Matching variable to a list index Gilush 17 5,853 Nov-30-2020, 01:06 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020