歌手.io用于从MongoDB Pipelinewise compatible中提取数据的点击

pipelinewise-tap-mongodb的Python项目详细描述


流水线式龙头mongodb

这是一个Singertap,它从MongoDB源生成Singer spec后面的JSON格式的数据。在

设置本地开发环境:

make setup

激活虚拟环境

^{pr2}$

设置配置文件

创建名为config.json的json文件,其内容如下:

{"password":"<password>","user":"<username>","host":"<host ip address>","port":"<port>","auth_database":"<database name to authenticate on>","database":"<database name to sync from>"}

以下参数对于配置文件是可选的:

NameTypeDefault valueDescription
^{}stringnullname of replica set
^{}Booleanfalsecan be set to true to connect using ssl
^{}BooleantrueDefault SSL verify mode
^{}Booleanfalseforces the stream names to take the form ^{} instead of ^{}
^{}int1[LOG_BASED] The size of the buffer that holds detected update operations in memory, the buffer is flushed once the size is reached
^{}int1000[LOG_BASED] The maximum amount of time in milliseconds the loge_base method waits for new data changes before exiting.

tap需要以上所有属性才能连接到mongo实例。 这是一个sample configuration file。在

在发现模式下运行

运行以下命令并将输出重定向到目录文件中

tap-mongodb --config ~/config.json --discover > ~/catalog.json

目录文件现在应该如下所示:

{"streams":[{"table_name":"<table name>","tap_stream_id":"<tap_stream_id>","metadata":[{"breadcrumb":[],"metadata":{"row-count":<int>,"is-view":<bool>,"database-name":"<database name>","table-key-properties":["_id"],"valid-replication-keys":["_id"]}}],"stream":"<stream name>","schema":{"type":"object"}}]}

编辑目录文件

使用有效的json,编辑配置.json文件

要选择流,请在流的元数据中输入以下内容:

"selected":true,"replication-method":"<replication method>",

<replication-method>必须是FULL_TABLEINCREMENTAL或{},如果是{},请确保添加"replication-key"。在

例如,如果要编辑示例流以选择流并添加投影,配置.json应该是这样的:

{"streams":[{"table_name":"<table name>","tap_stream_id":"<tap_stream_id>","metadata":[{"breadcrumb":[],"metadata":{"row-count":<int>,"is-view":<bool>,"database-name":"<database name>","table-key-properties":["_id"],"valid-replication-keys":["_id"],"selected":true,"replication-method":"<replication method>"}}],"stream":"<stream name>","schema":{"type":"object"}}]}

以同步模式运行:

tap-mongodb --config ~/config.json --catalog ~/catalog.json

tap将把书签写入stdout,它可以被捕获并作为可选的--state state.json参数传递给tap以进行下一次同步。在

日志记录配置

tap使用预定义的日志配置(如果没有提供),但是您可以通过设置环境变量LOGGING_CONFIG_FILE作为日志配置的路径来设置自己的配置。 示例配置可用here。在


版权所有©2020 TransferWise

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java从Dropwizard中的Minio检索文件时,GET请求中的超时是如何处理的?   带Hibernate的java Jackson用于序列化以避免枚举   Raspberry Pi上的java Jave分段错误   java在屏幕旋转时不保存当前片段和数据   java War文件未在Heroku上正确部署   如何使用Java处理Selenium webdriver中的促销广告或cookie   java处理“用法:PApplet[options]<classname>[sketch args]”   java文本文件错误扫描程序   运行第一个JavaFX模块化程序时出现java异常   java将fileoutputstream转换为字符串   如何调试gstreamerjava?   java Spring RestTemplate ResponseBody类是什么样的   如何将JSON数组转换为Java列表。我在用斯文森   javascript在显示div按钮后进入新页面