Meteor MongoDB从对象获取数组

时间:2022-05-04 17:08:37

I am trying to get one simple thing done by MongoDB without any luck for a week or so.

我试图让MongoDB做一件简单的事情,一周左右没有运气。

Here is a document I have { _id: "mkikuQzrYdyQjL7Ry", links:[ 1: "link1" 2: "link2" 3: "link3" 4: "link4" ] }

这是我有一个文件{_id:“mkikuQzrYdyQjL7Ry”,链接:[1:“link1”2:“link2”3:“link3”4:“link4”]}

How can I receive all the items from the "links" array with one request to MongoDB?

如何通过向MongoDB发出一个请求从“links”数组中接收所有项目?

1 个解决方案

#1


0  

The answer is CollectionName.findOne("mkikuQzrYdyQjL7Ry").links thanks to JeremyK && webdev

答案是CollectionName.findOne(“mkikuQzrYdyQjL7Ry”)。感谢JeremyK && webdev

#1


0  

The answer is CollectionName.findOne("mkikuQzrYdyQjL7Ry").links thanks to JeremyK && webdev

答案是CollectionName.findOne(“mkikuQzrYdyQjL7Ry”)。感谢JeremyK && webdev