Meteor.js和Mongoose的兼容性 [英] Meteor.js and Mongoose Compatibility

查看:49
本文介绍了Meteor.js和Mongoose的兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想主要在服务器端对流星使用Mongoose ORM,直到流星发布模式方法.

I want to use the Mongoose ORM with meteor mainly on the server side until meteor releases a schema approach.

我可以在Meteor方法中调用Mongoose ORM操作并使用像findById这样的Mongoose检索方法进行发布.

Can i call Mongoose ORM operations within Meteor methods and publish using the Mongoose retrieving methods likefindById.

如果我以这种方式处理事情,是否有任何潜在的问题或流星特征会错过?

Are there any potential problems or meteor features that i would miss out on if i approached things this way?

推荐答案

不幸的是,存在问题.我们想做同样的事情,但是(开箱即用)猫鼬包不使用Meteor的DDP协议,并且在执行CRUD操作时不会触发反应性.尽管我们对Mongoose的搜索不足,但Fibers/etc可能也存在问题.

Unfortunately, there are problems. We've wanted to do the same thing, but (out of the box) the mongoose package doesn't use Meteor's DDP protocol, and won't trigger the reactivity when you do CRUD operations. There may be also issues with Fibers/etc, although we haven't pushed with Mongoose enough to find them.

好消息是,(服务器端)Meteor监视db是否有DDP引起的任何更改,并将在大约10秒左右的时间内恢复它们.然后它将它们发布给客户端,客户端将以标准的流星格式将它们拾取.

The good news is that (server-side) Meteor watches the db for any changes, DDP-induced or not, and will pick them up in about 10-seconds or so. It will then publish them to the clients, which will pick them up in standard meteor format.

我们一直在寻找一个mongoose-ddp-meteor软件包来解决此问题,并且可能最终不得不自己构建一个.

We've been looking for a mongoose-ddp-meteor package to solve this issue, and might have to end up building one ourselves.

截至2013年12月,Meteor的Mongo软件包会监听Mongo的操作日志,并将实时反映外部猫鼬活动所做的任何更改.

As of December 2013, Meteor's Mongo package listens to Mongo's oplog, and will reflect any changes done by external mongoose activity in real-time.

这篇关于Meteor.js和Mongoose的兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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