问题标签 [meteor-collections]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
85 浏览

mongodb - 在 Meteor 中选择虚假文档

我有一个 Meteor 集合,我想在其中指定一个查询来查找属性为假的所有文档。换句话说,在它不存在的地方,null,false。在本机 Mongo 中,以下语法有效:

在这种情况下,所有文档都没有该元素showOnList,因此与我的查询匹配。在 Meteor(客户端)中,使用此语法时出现以下错误:

还有其他人遇到这个问题并有解决方法吗?这是流星虫吗?

0 投票
1 回答
104 浏览

mongodb - STDERR Meteor app crash with exit 8 after adding new collection (now just crashing repeatedly?)

Hello world: this is my first stackoverflow question. After searching through other questions and the Meteor documentation I can't seem to figure this one out. I'm working with a clone of the scotch.io meteor-polling app, and I wanted to add a new Mongo collection, which started throwing errors(STDERRs with no messages) when I tried to run the app with it included. So, I removed all references to the collection: my code is the same as it was when it was working properly with just one collection, and I'm still getting errors. Very puzzled. Tried Meteor reset and update to no avail.

here's my repo: https://github.com/abraxasrex/meteor-polling

the code that starting giving errors is the current master.

I'm fairly certain from my debugging that it was either the insertion of the collection or adding votes=[] to newpoll in client/components/poll-form.js(?)

0 投票
1 回答
72 浏览

javascript - AngularJS流星mongo集合键值

我有这个代码

我期待返回这样的值

但它仍然返回这样的值

这是一个错误吗?或者编码不好...

0 投票
0 回答
47 浏览

meteor - 流星,图像上传无法在实时网站上运行

我正在使用 cfs:s3,在此之前我尝试过 cfs:dropbox 来存储图像。当我在本地运行该应用程序时,它运行良好,但是当我在meteor.com 上部署它时,它停止将图像上传到任一平台。

对此有任何已知问题吗?

S3 的政策

0 投票
2 回答
159 浏览

mongodb - Meteor - 卸载现有的 mongo 集合

我们正在创建基于 Meteor 的 Mongo 数据库管理器,当我们切换数据库时,我们需要能够“卸载”(从系统中删除)所有集合。

例子:

  • 我正在管理名为 dbA 的数据库。我们在服务器和客户端使用 Mongo.Collection() 创建了该数据库的所有集合。
  • 我想将数据库切换到 dbB。我需要卸载 dbA 的所有集合并安装 dbB 的集合。原因:dbB 可能有一个与 dbA 同名的集合(通常是这样)

有没有办法做到这一点?

谢谢!

0 投票
1 回答
79 浏览

meteor - Meteor:反应式更新,级联删除/更新。规范化与非规范化

如何在现有加入的文档中进行级联删除、更新和响应式更新?比如说我以作者身份加入Posts收藏。我可以对集合执行转换功能以获取作者的用户数据,例如在任何帖子上显示作者。问题是当用户更改他/她时,现有帖子不会反应性地更新作者的。当您删除父文档时,子文档仍然存在。我使用了流行的智能包,例如and,但问题仍然存在。任何专家流星开发可以帮助我吗?谢谢你。Meteor.usersuserId()Postsusernameusernameusernameusernamepublish-compositecollection-helpers

0 投票
1 回答
91 浏览

mongodb - 需要更改流星集合_id的大小

正如我们所知.. 插入后的 Meteor 集合返回一个 16 字符 id,这对我来说太多了。我可以更改流星集合 _id 生成以生成 6 char id 而不是 16 char 吗?

0 投票
0 回答
139 浏览

javascript - Meteor.js collection & user permission structure

We are starting development of a meteor app that allows users to create a profile, submit a set of search criteria and receive products (held in the app's db) curated by an administrator. I am wondering what the most elegant way of setting up the collections for this would be.

So far, our thinking is to:

  1. Automatically generate user id's (accounts-ui package) and roles (alanning:meteor-roles package) as soon as the search process is started
  2. Add all user information, including the user id and role generated in step 1, to a "clients" collection
  3. Add all search criteria selected by the user, as well as the user-id, to a separate "searches" collection.
  4. Use search criteria to filter objects in a "products" collection, and deliver results to an admin who then manually curates from filtered results.

Given the information I've provided, does this sound like the most elegant structure?

0 投票
1 回答
28 浏览

meteor - 在meteor.js 中查找文档

我希望有人能澄清有关 Meteor.js 订阅的这一点:

如文档中所写, find() 函数返回需要获取的游标,而不是数据;假设我有一个发布功能:

现在假设我只需要带有代码的页面:“one”;在模板助手中,我可以获取该文档:

问题是:这样做是否正确,或者如果我只需要一份文件,最好只订阅该文件?(就像是:

)

我的意思是:它在效率/性能方面是否有所改变?

0 投票
0 回答
257 浏览

meteor - 流星collection.find().fetch(),在iron路由器的客户端上运行返回一个空数组

这是我在客户端名为 route.js 的文件中的代码:

当我运行它时,cursorData 返回:
L…n.Cursor {collection: LocalCollection, sorter: null, matcher: M…o.Matcher, _selectorId: undefined, skip: undefined…}

cursorData obj 包含我正在寻找的数据,我可以使用 forEach 来获取,但我想将它作为一个数组来访问。

所以,这是我使用 fetch() 的代码。

现在 cursorData 返回:
cursorData = []

我没有使用 pub/sub,但这个问题的所有解决方案都建议使用它,所以我尝试了它并没有任何区别。
我已经对此进行了编程,但是作为新手并试图学习 Meteor 的细微差别,我想了解为什么当我看到它在其他地方使用时我不能让它工作。