サーバーからモデルをフェッチするコレクションがあります。
これは機能します。モデルをそのIDで取得したいので、次のようにMyCollection.at(0)
なります。
child
_changes: Array[0]
_changing: false
_currentAttributes: Object
_events: Object
_hasComputed: true
_pending: false
_previousAttributes: Object
attributes: Object
_id: "50ef7a63b2a53d17fe000001"
author_name: "author name"
bookmark: ""
info: "bookmark description"
__proto__: Object
changed: Object
cid: "c26"
collection: child
view: child
__proto__: Surrogate
IDでモデルを取得しようとすると、次のようになります。
MyCollection.get("50ef7a63b2a53d17fe000001")
=> undefined
MyColleciton.get({_id:"50ef7a63b2a53d17fe000001"})
=> undefined
MyCollection.get({'_id':"50ef7a63b2a53d17fe000001"})
=> undefined
私はそれを理解していません-ドキュメントは.get()
、指定されたIDを持つモデルがそのコレクションに存在する場合、メソッドがモデルを返すことを明確に述べています。