Python 可以写入数据库并响应 Meteor 更新吗 [英] Can Python write to database and Meteor reactively update

查看:33
本文介绍了Python 可以写入数据库并响应 Meteor 更新吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python 能否将数据写入数据库 (mongdb) 并让 Meteor 接收数据库写入的更新并更新前端?

Can Python be writing data to a database (mongdb) and have Meteor receive updates of the database writes and update the frontend?

推荐答案

Meteor 0.7.2 及更高版本通过 oplog 观察驱动程序.对 Mongo 的写入立即反映在数据库支持的任何 Meteor 服务器上.

Meteor 0.7.2 and later implements this functionality fully via the oplog observe driver. Writes to Mongo are immediately reflected on any Meteor servers backed by the database.

这是通过让 Meteor 观察 Mongo oplog 中的操作来实现的,这样任何数据库操作都会立即合并到实时数据游标中.在以前的 Meteor 版本中,这是通过轮询发生的,这可能需要长达 10 秒的时间来传播数据.但是,现在有了最新的驱动程序,一切都会立即发生.

This is achieved by having Meteor watch the operations in the Mongo oplog, so that any database operations are incorporated into live data cursors immediately. In previous versions of Meteor, this happened via polling, which could take up to 10 seconds for data to propagate. However, everything is now immediate with the latest driver.

这篇关于Python 可以写入数据库并响应 Meteor 更新吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆