0
我對Meteor並不陌生,但因爲在其他項目上工作而離開了幾個星期。Collection.findOne({_ id:「stringidsdfdsfdsfds」})返回undefined
我現在正在使用React處理Meteor項目。
當我這樣做Collection.find({}).fetch()
它返回:
[
{
"_id": { "_str": "59d3b91d80f4f5eeb0162634" },
"title": "My first Post",
"content": "This is the body of the pst"
}
]
唯一奇怪的是_id
場。
但是,當我做Collection.findOne({_id: "59d3b91d80f4f5eeb0162634" })
時,它返回undefined
。
如何使用_id
字符串作爲查詢參數來執行.findOne()
?
嗨,謝謝你。我實際上是從「流星蒙哥」控制檯插入的。 – Kenshinman
@Kenshinman我建議你使用'meteor shell'控制檯來做這樣的事情。 – Styx