![]() Server = self._select_server(selector, server_selection_timeout, address)įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\topology.py", line 261, in _select_server Server = lect_server(server_selector)įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\topology.py", line 272, in select_server Server = self._select_server(read_pref, session, address=address)įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\mongo_client.py", line 1229, in _select_server Return self._client._retryable_read(_cmd, read_preference, session)įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\_csot.py", line 105, in csot_wrapperįile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\mongo_client.py", line 1413, in _retryable_read Res = admin._retryable_read_command(cmd, session=session)įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\database.py", line 843, in _retryable_read_command Return for doc in self.list_databases(session, nameOnly=True, comment=comment)]įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\mongo_client.py", line 1812, in list_databases Print("Your DB: exsist!!!!".format(mydb_Name))Īnd error raise: Traceback (most recent call last):įile "C:\Users\chuan\OneDrive\Desktop\10.13_connect_mongoDB\2.py", line 13, in įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\mongo_client.py", line 1839, in list_database_names Print("now exsisting DB are: ",client.list_database_names()) # set mydb will have all properties from myclient #connect to my desire mongoDB by IP addressĬlient = pymongo.MongoClient("mongodb://:27017") #Mongodb compass current topology does not support sessions codeHere is my tried code after using client.list_database_names() import pymongo If I want to list up all the collections/tables from cloud_db (in the mongoDB picture above) and maybe read and write to cloud_db's one of the collection named eform_detail, then what should I do? Online image link:(about the actual mongoDB I want to connect, print, If you meant to call the 'collection_names' method on a 'Database' object it is failing because no such method exists. TypeError: 'Collection' object is not callable. MongoClient(host=, document_class=dict, tz_aware=False, connect=True)įile "C:\Users\chuan\OneDrive\Desktop\10.13_connect_mongoDB\1.py", line 11, in įile "C:\Users\chuan\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\collection.py", line 3194, in _call_ py code for read and write from an existing mongoDB by IP addressĬlient =pymongo.MongoClient("mongodb://:27017")Īnd output is not found: C:\Users\chuan\OneDrive\Desktop\10.13_connect_mongoDB>python 1.py I should make more clear that I have actual mongoDB collection/table with IP address (x is for actual ip address ) I have IP address and existing mongoDB(already have company's collection/table), Saying that technically using (Windows pymongo python script) can read and write to mongoDB. How can I read and write from an existing mongoDB by IP address? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |