本文整理汇总了Python中pybabe.Babe.push_mongo方法的典型用法代码示例。如果您正苦于以下问题:Python Babe.push_mongo方法的具体用法?Python Babe.push_mongo怎么用?Python Babe.push_mongo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pybabe.Babe
的用法示例。
在下文中一共展示了Babe.push_mongo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pushpull
# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import push_mongo [as 别名]
def test_pushpull(self):
a = Babe().pull(stream=StringIO(self.s2), format='csv', primary_key='rown')
a = a.typedetect()
a.push_mongo(db='pybabe_test',collection='test_pushpull', drop_collection=True)
b = Babe().pull_mongo(db="pybabe_test", fields=['rown', 'f', 's'], collection='test_pushpull')
buf = StringIO()
b.push(stream=buf, format='csv')
self.assertEquals(buf.getvalue(), self.s2)
示例2: test_pushpull
# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import push_mongo [as 别名]
def test_pushpull(self):
a = Babe().pull(string=self.s2, format="csv", primary_key="rown")
a = a.typedetect()
a.push_mongo(db="pybabe_test", collection="test_pushpull", drop_collection=True)
b = Babe().pull_mongo(db="pybabe_test", fields=["rown", "f", "s"], collection="test_pushpull")
self.assertEquals(b.to_string(), self.s2)
示例3: test_push
# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import push_mongo [as 别名]
def test_push(self):
a = Babe().pull(string=self.s1, format="csv", primary_key="rown")
a = a.typedetect()
a.push_mongo(db="pybabe_test", collection="test_push")
示例4: test_push
# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import push_mongo [as 别名]
def test_push(self):
a = Babe().pull(string=self.s1, format='csv', primary_key='rown')
a = a.typedetect()
a.push_mongo(db='pybabe_test',collection='test_push')
示例5: test_pushpull
# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import push_mongo [as 别名]
def test_pushpull(self):
a = Babe().pull(string=self.s2, format='csv', primary_key='rown')
a = a.typedetect()
a.push_mongo(db='pybabe_test',collection='test_pushpull', drop_collection=True)
b = Babe().pull_mongo(db="pybabe_test", fields=['rown', 'f', 's'], collection='test_pushpull')
self.assertEquals(b.to_string(), self.s2)