本文整理汇总了Python中flask.ext.pymongo.MongoClient.get_default_database方法的典型用法代码示例。如果您正苦于以下问题:Python MongoClient.get_default_database方法的具体用法?Python MongoClient.get_default_database怎么用?Python MongoClient.get_default_database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask.ext.pymongo.MongoClient
的用法示例。
在下文中一共展示了MongoClient.get_default_database方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PyMongo
# 需要导入模块: from flask.ext.pymongo import MongoClient [as 别名]
# 或者: from flask.ext.pymongo.MongoClient import get_default_database [as 别名]
from app import app
from flask.ext.pymongo import PyMongo, MongoClient
from py2neo import Graph
# connect to MongoDB with the defaults
mongo1 = PyMongo(app)
## connect to another MongoDB database on the same host
app.config['MONGO2_DBNAME'] = 'evgroio-dev'
mongo2 = PyMongo(app, config_prefix='MONGO2')
app.config['MONGO3_DBNAME'] = 'test'
mongo3 = PyMongo(app, config_prefix='MONGO3')
# Affective Computing Databases
app.config['ANALYSIS_DBNAME'] = 'affect-analysis-interceptor'
affect_analysis = PyMongo(app, config_prefix='ANALYSIS')
#remoteDB1
mongolab_uri = 'mongodb://evgroio01:[email protected]:41238/heroku_app36697506'
client = MongoClient(mongolab_uri,
connectTimeoutMS=30000,
socketTimeoutMS=None,
socketKeepAlive=True)
remoteDB1 = client.get_default_database()
## connect to default instance of neo4j
secure_graph1 = Graph("http://neo4j:[email protected]:7474/db/data/")