小编Elr*_*rot的帖子

流星没有蒙戈

使用0.6.5版本,可以使用meteor开发非Web应用程序.我从头开始为ARM处理器重建它,但我根本不需要DB支持.(Mongo是一个处理器杀手,占用空间很大,我根本不需要它)

ARM应该仅作为DDP客户端工作,考虑到这一点,我手动构建它而不使用mongo.

并尝试构建最简单的应用程序可能只在开始时包1(所有标准包已删除)

meteor
Run Code Online (Sandbox Code Playgroud)

和服务器文件夹中的一个文件

main = function(argv){
  return "DAEMON"
}

Meteor.setInterval(function(){
  console.log("HellOnWorld");
},1000);
Run Code Online (Sandbox Code Playgroud)

在完全流星安装的机器上它按预期工作但没有安装mongo我得到错误

Unexpected mongo exit code 127. Restarting.
Unexpected mongo exit code 127. Restarting.
Initializing mongo database... this may take a moment.
Unexpected mongo exit code 127. Restarting.
Can't start mongod
Run Code Online (Sandbox Code Playgroud)

显然我没有并且想要mongo.

有没有办法在不等mongo db的情况下启动流星?

Meteor团队计划支持其他数据库,因此必须迟早实施.

mongodb meteor

14
推荐指数
4
解决办法
9749
查看次数

Meteor template.rendered - 为什么收集是空的?

为什么在以下基本示例中返回的集合在渲染函数内是空的?
自动发布已启用.页面加载
Coll.find().fetch()javascript控制台内的调用命令后返回正确的条目集

这是代码

t.js

Coll = new  Meteor.Collection("coll");

if (Meteor.isClient) {
  Template.tpl.rendered = function(){
    console.log(Coll.find().fetch()); // <-- This line prints empty array
  };
}

if (Meteor.isServer) {
  Meteor.startup(function () {
      if (Coll.find().count() === 0) {
          var f = ["foo","bar"];
          for (var i = 0; i < f.length; i++)
              Coll.insert({f: f[i]});
      }
  });
}
Run Code Online (Sandbox Code Playgroud)

t.html提交

<head>
  <title>test</title>
</head>

<body>
  {{> tpl}}
</body>

<template name="tpl">
  Test tpl
</template>
Run Code Online (Sandbox Code Playgroud)

meteor

6
推荐指数
1
解决办法
3011
查看次数

标签 统计

meteor ×2

mongodb ×1