{"published":"2013-03-20 02:55:04","description":"node.js\u3044\u3058\u3063\u3066\u307e\u3059\u3002 \u3055\u3089\u3063\u3068\u5099\u5fd8\u9332 mongoose.Schema.Types.ObjectId ObjectId\u306e\u6bd4\u8f03\u306f===\u3067\u306f\u30c0\u30e1\u3001anObjectId.equals(anotherObjectId)\u3092\u4f7f\u3046 Array.indexOf(obj) // mongoose\u306e\u30e2\u30c7\u30eb var FooSchema = new Schema( {bars: [{type: ObjectId, ref: hoge}])} Array.indexOf(obj)\u3067\u306e\u6bd4\u8f03\u306f===\u3067\u3084\u3063\u3066\u308b underscore.js\u306e_.contains(array, obj)\u3082\u305d\u3046\u3002 // bars\u306e\u4e2d\u306banB\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqsona.hatenadiary.org%2Fentry%2F20130320%2F1363802104\" title=\"MongooseArray\u306eindexOf - qsona\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/qsona/","version":"1.0","provider_url":"https://hatena.blog","url":"https://qsona.hatenadiary.org/entry/20130320/1363802104","width":"100%","author_name":"qsona","height":"190","image_url":null,"blog_title":"qsona\u306e\u65e5\u8a18","blog_url":"https://qsona.hatenadiary.org/","title":"MongooseArray\u306eindexOf","type":"rich","provider_name":"Hatena Blog","categories":["node.js","JavaScript","mongoose"]}