设置与Airflow的MongoDB连接

编程入门 行业动态 更新时间:2024-10-25 02:22:23
本文介绍了设置与Airflow的MongoDB连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

根据天文学家文档

尽管如此,我仍然不确定如何在Extras中构造JSON.我试过了: {uri:mongodb + srv://myuser:mypass@my-cluster.dwxnd.gcp.mongodb/mydb?retryWrites = true& w = majority} ,但这不是工作:

这看起来应该很明显,但是我正在努力.使用我们来自MongoDB Atlas的MongoDB URI在Airflow中创建此连接的正确方法是什么?

解决方案

这是我会尝试的:

  • Conn类型: mongodb + srv (或 mongodb )
  • 主机: my-cluster.blahlah.mongodb ,
  • 登录名:<用户名> ,密码:< password> .
  • 模式:管理员(或您的authDB)
  • JSON对象就是这么简单
  • {retryWrite:true,< field> ;:值,w:多数}

    According to Astronomer docs here:

    Despite this, I'm still not quite sure how to structure the JSON in Extras for this. I've tried: { uri: mongodb+srv://myuser:mypass@my-cluster.dwxnd.gcp.mongodb/mydb?retryWrites=true&w=majority } in the Extras but that doesn't work:

    It seems like this should be obvious, yet I am struggling. What's the correct way, using our MongoDB URI from MongoDB Atlas, to create this connection in Airflow?

    解决方案

    This is what I would try:

  • Conn Type: mongodb+srv (or mongodb)
  • Host:my-cluster.blahlah.mongodb,
  • Login: <username>, Password: <password>.
  • Schema: admin (or your authDB)
  • The JSON object is as simple as this
  • { retryWrite:true, <field>:value, w:majority }

    更多推荐

    设置与Airflow的MongoDB连接

    本文发布于:2023-10-26 09:50:30,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1529802.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:Airflow   MongoDB

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!