'neo4j' python library -- specifying database

I have created a database called 'foo' and i can switch to it in the browser and interact with it, but when I try to programmatically write to it using python neo4j library, I can only interact with the default database 'neo4j'. When I run the below code, it writes to 'neo4' database. Note the line that sets the driver session. Am I using this incorrectly?


from neo4j import GraphDatabase
import os

class HelloWorldExample:

    def __init__(self, uri, user, password):
        self.driver = GraphDatabase.driver(uri, auth=(user, password))

    def close(self):

    def print_greeting(self, message):
        with self.driver.session(database='foo') as session:   # I expected this to work
            greeting = session.write_transaction(self._create_and_return_greeting, message)

    def _create_and_return_greeting(tx, message):
        result = tx.run("CREATE (a:Greeting) "
                        "SET a.messsage = $message "
                        "RETURN a.message + ', from node ' + id(a)", message=message)
        return result.single()[0]

if __name__ == "__main__":

    greeter = HelloWorldExample("bolt://" + AWS_DNS + "/:7687", os.environ['NEO4J_USERNAME'], os.environ['NEO4J_PASSWORD'])
    greeter.print_greeting("hello, world 13")