本文整理汇总了Python中couchbase.bucket.Bucket.endure_multi方法的典型用法代码示例。如果您正苦于以下问题:Python Bucket.endure_multi方法的具体用法?Python Bucket.endure_multi怎么用?Python Bucket.endure_multi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类couchbase.bucket.Bucket
的用法示例。
在下文中一共展示了Bucket.endure_multi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in
# 需要导入模块: from couchbase.bucket import Bucket [as 别名]
# 或者: from couchbase.bucket.Bucket import endure_multi [as 别名]
for x in ("joe", "jim", "bill", "larry")])
# Save them all
cb.upsert_multi(players)
# Give them all some points
for p, options in players:
p.score += randint(20, 2000)
# also set the email?
if not p.email:
p.email = "{0}@{0}.notspecified.com".format(p.name)
cb.replace_multi(players)
all_players = ItemSequence([x[0] for x in players] + [single_player])
INDENT = " " * 3
for player in all_players.sequence:
print "Name:", player.name
print INDENT , player
lines = []
lines.append("email: {0}".format(player.email))
lines.append("score: {0}".format(player.score))
for line in lines:
print INDENT, line
cb.remove_multi(all_players)
cb.endure_multi(all_players, check_removed=True, replicate_to=0,
persist_to=1)