我正在使用流星,并且我没有输入“流星删除自动发布”,因此我相信我的客户能够毫无问题地检索 mongo 集合“列表”。
所以我在 List 集合中添加了 1 个对象,但我似乎无法从对象中检索数据。
List.find().fetch() //i wrote this in the console and the next few lines was the reply
[{…}]
0
:
{_id: "JqsKLoY4sx9qT8ZRR", module: "Math", user: "Tom"}
length
:
1
__proto__
:
Array(0)
但是当我写 conosle.log(List.find({module: "Math"}).user) 时,控制台中返回给我的内容是“未定义”。
这是有原因的还是我做错了什么?我想检索用户名“Tom”。因为我最终真正想做的是使用 javascript 本身中的值,例如 - var creator = List.find({module: "Math"}).user