def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') log.info( "\n\n\nMongodb example to use data from Furniture module, so get it.") furniture = learn_data.get_furniture_data() log.info("\n\n\nHere's the MongoDB script.") mongodb_script.run_example(furniture) log.info("Other databases use data embedded in the modules") log.info("\n\n\nHere's the Redis script.") redis_script.run_example() log.info("\n\n\nHere's the Neo4J script.") neo4j_script.run_example() log.info( "\n\n\nHere's the persistence/serialization (Pickle/Shelve) script.") simple_script.run_example(furniture)
def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') log.info("Mongodb example to use data from Furniture module, so get it") furniture = learn_data.get_furniture_data() roygbiv = ["Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"] for item in furniture: product_type = item['product'] color_name = 'N/A' for color in roygbiv: if color in product_type: color_name = color product_type = product_type.replace(color, '').lstrip(' ') break item['color'] = color_name item['product type'] = product_type mongodb_script.run_example(furniture) log.info("Other databases use data embedded in the modules") redis_script.run_example() neo4j_script.run_example() simple_script.run_example(furniture) persistence_serialization.run_json()
def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') log.info("Mongodb example to use data from Furniture module, so get it") furniture = learn_data.get_furniture_data() mongodb_script.run_example(furniture) log.info("Other databases use data embedded in the modules") redis_script.run_example() neo4j_script.run_example() simple_script.run_example(furniture)
def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') # New furniture data source furniture = new_data.get_furniture_data() persistence = movie_data.get_movie_data() log.info("Running MongoDB exercise") mongodb_script.run_example(furniture) log.info("Running Redis exercise") redis_script.run_example() log.info("Running Neo4J exercise") neo4j_script.run_example() log.info("Running persistence and serialization exercise") simple_script.run_example(furniture, persistence)