The database method on views allows specifying the database to query from.
User.by_login.database(User.tmp_database).key("bla").first
However the database parameter gets added to the query so it's also present in the url. So the couch logs for this query for me show:
GET /tmp_users/_design/User/_view/by_login?database=http%3A%2F%2Flocalhost%3A5984%2Ftmp_users&key=%22bla%22&limit=1&include_docs=true&reduce=false 200
I would expect the query to not contain the database:
GET /tmp_users/_design/User/_view/by_login?key=%22bla%22&limit=1&include_docs=true&reduce=false 200
The database parameter clutters the query and also leaks credentials in the couch logs.
The database method on views allows specifying the database to query from.
However the database parameter gets added to the query so it's also present in the url. So the couch logs for this query for me show:
I would expect the query to not contain the database:
The database parameter clutters the query and also leaks credentials in the couch logs.