node.js – Meteor如何接收MongoDB查询结果的更新?

几个月前我问了一个问题,哪个流星似乎有答案。

Which,if any,of the NoSQL databases can provide stream of *changes* to a query result set?

Meteor如何接收MongoDB查询结果的更新?

谢谢,

克里斯。

解决方法

从文档:

  • On the server,a collection with that name is created on a backend Mongo server. When you call methods on that collection on the server,
    they translate directly into normal Mongo operations.

  • On the client,a Minimongo instance is created. Minimongo is essentially an in-memory,non-persistent implementation of Mongo in
    pure JavaScript. It serves as a local cache that stores just the
    subset of the database that this client is working with. Queries on
    the client (find) are served directly out of this cache,without
    talking to the server.

When you write to the database on the client (insert,update,remove),
the command is executed immediately on the client,and,
simultaneously,it’s shipped up to the server and executed there too.
The livedata package is responsible for this.

这说明客户端到服务器

服务器到客户端,我可以收集的是livedata和mongo-livedata包。

https://github.com/meteor/meteor/tree/master/packages/mongo-livedata

https://github.com/meteor/meteor/tree/master/packages/livedata

希望有帮助。

相关文章

这篇文章主要介绍“基于nodejs的ssh2怎么实现自动化部署”的...
本文小编为大家详细介绍“nodejs怎么实现目录不存在自动创建...
这篇“如何把nodejs数据传到前端”文章的知识点大部分人都不...
本文小编为大家详细介绍“nodejs如何实现定时删除文件”,内...
这篇文章主要讲解了“nodejs安装模块卡住不动怎么解决”,文...
今天小编给大家分享一下如何检测nodejs有没有安装成功的相关...