【问题标题】:meteor sync models to an JSON API instead of mongodb流星同步模型到 JSON API 而不是 mongodb
【发布时间】:2014-07-17 04:24:22
【问题描述】:

我正在编写一个应用程序,我计划使用流星作为我的前端,并且我已经用sailsjs 应用程序编写了我的后端api。

有没有办法打破meteor中保存模型对mongodb的依赖?我可以使用 JSON api 创建/更新/销毁模型吗?

【问题讨论】:

    标签: javascript meteor sails.js


    【解决方案1】:

    我不是 Meteor.js 方面的专家,但我是个瘾君子。 我相信可以通过仅使用客户端 Meteor.Collection http://docs.meteor.com/#meteor_collection 来实现 以下是关于stackoverflow的一些类似问题: Client-side-only reactivity with Meteor? How to sort a client-side-only (local) Meteor Collection

    然后使用 Meteor 方法: http://docs.meteor.com/#methods_header https://stackoverflow.com/a/13145432/1147242

    对您的sailsjs API 执行所有CRUD。

    这是 Eventedmind 关于本地收藏的视频:https://eventedmind.com/classes/how-to/meteor-how-to-publish-to-a-client-only-collection 在 Meteor.Methods 上:https://eventedmind.com/feed/meteor-methods

    希望它会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      • 1970-01-01
      • 2014-08-04
      • 2015-11-12
      • 1970-01-01
      • 2017-09-05
      • 2013-11-24
      相关资源
      最近更新 更多