Skip to content

Commit 5fdd832

Browse files
authored
list collections
1 parent 00e77e6 commit 5fdd832

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,21 @@ Making a connection with authentication:
2828
>>> client.database_names()
2929
[u'admin', u'local', u'mycargarage', u'random_api', u'shared_db', u'testdb']
3030
```
31+
32+
### Listing Databases
33+
34+
35+
```
36+
>>> client = MongoClient(uri)
37+
>>> client.database_names()
38+
[u'admin', u'local', u'mycargarage', u'random_api', u'shared_db', u'testdb']
39+
```
40+
41+
### Listing Collections
42+
43+
```
44+
>>> client = MongoClient(uri)
45+
>>> db = client.shared_db
46+
>>> db.collection_names()
47+
[u'flask_reminders', u'test', u'usersessions', u'messages']
48+
```

0 commit comments

Comments
 (0)