Skip to content

Commit

Permalink
Merge pull request #248 from IlyaSkriblovsky/mongodb+srv
Browse files Browse the repository at this point in the history
support for mongodb+srv:// uri scheme
  • Loading branch information
psi29a authored Mar 25, 2019
2 parents db7f5f3 + 8280fd9 commit bece8c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
keywords=["mongo", "mongodb", "pymongo", "gridfs", "txmongo"],
packages=["txmongo", "txmongo._gridfs"],
install_requires=["twisted>=14.0", "pymongo>=3.0"],
extras_require={
'srv': ['pymongo[srv]>=3.6'],
},
license="Apache License, Version 2.0",
include_package_data=True,
test_suite="nose.collector",
Expand Down
2 changes: 1 addition & 1 deletion txmongo/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def __init__(self, uri="mongodb://127.0.0.1:27017", pool_size=1, ssl_context_fac
assert isinstance(pool_size, int)
assert pool_size >= 1

if not uri.startswith("mongodb://"):
if not uri.startswith("mongodb://") and not uri.startswith("mongodb+srv://"):
uri = "mongodb://" + uri

self.__uri = parse_uri(uri)
Expand Down

0 comments on commit bece8c2

Please sign in to comment.