首页 移动开发 在线交易 IT笔记 网络技术 操作系统 企业架构 数据库 考试认证 IT培训 开源软件 数据存储 行业资讯
大家都在看:java   开发   C#   oracle   mysql   android   web开发   学习   sqlserver   linux   asp   php   ajax   javascript   css   html
pymongo 副本及链接 说明
2014-11-17 09:51:02 来源: 作者:admin 栏目:nginx 责任编辑:
[导读] ReplicaSetConnection('%s:27018,%s:27018,%s:27018' % ('ip0','ip2','ip1'), replicaSet = 'rs0', read_preference=0)['beehoo']read_preference 解释: | | NEAREST = 4 | | PRIMARY = 0 | | PRIMARY_PREFERRED = 1 | | SECONDARY = 2 | | SECONDARY_ONLY = 2 ..
ReplicaSetConnection('%s:27018,%s:27018,%s:27018' % ('ip0','ip2','ip1'), replicaSet = 'rs0', read_preference=0)['beehoo']


read_preference 解释:

|
|  NEAREST = 4
|
|  PRIMARY = 0
|
|  PRIMARY_PREFERRED = 1
|
|  SECONDARY = 2
|
|  SECONDARY_ONLY = 2
|
|  SECONDARY_PREFERRED = 3



MongoReplicaSetClient:

PRIMARY: Queries are sent to the primary of the replica set.
PRIMARY_PREFERRED: Queries are sent to the primary if available, otherwise a secondary.
SECONDARY: Queries are distributed among secondaries. An error is raised if no secondaries are available.
SECONDARY_PREFERRED: Queries are distributed among secondaries, or the primary if no secondary is available.
NEAREST: Queries are distributed among all members.
标签:
本站地址:/
版权所有:转载请注明出处!
分享到:
上一篇修改Host文件,让你的Google跑起.. 下一篇Nginx开启Gzip压缩大幅提高页面加..
您可能还喜欢
暂无...
今日最新资讯 最新推荐信息
考试认证 更多
开发技术 更多
移动开发 更多

关于 | 合作伙伴 | 联系我们 | 友情链接 | 版权声明 | 网站制作 | 网站地图 | 加入收藏 | 设为首页

Copyright@2012-2016 京ICP备12027873号