Fix find and remove functions to pass database param

This commit is contained in:
msciciel 2015-05-12 13:15:37 +02:00 committed by rallytime
parent c1157cdaee
commit 6f74477129

View File

@ -308,7 +308,7 @@ def insert(objects, collection, user=None, password=None,
def find(collection, query=None, user=None, password=None,
host=None, port=None, database='admin'):
conn = _connect(user, password, host, port)
conn = _connect(user, password, host, port, database)
if not conn:
return 'Failed to connect to mongo database'
@ -340,7 +340,7 @@ def remove(collection, query=None, user=None, password=None,
salt '*' mongodb.remove mycollection '[{"foo": "FOO", "bar": "BAR"}, {"foo": "BAZ", "bar": "BAM"}]' <user> <password> <host> <port> <database>
"""
conn = _connect(user, password, host, port)
conn = _connect(user, password, host, port, database)
if not conn:
return 'Failed to connect to mongo database'