Mongoid 3.1.4
Rails(3.2.13
)アプリに使用して、MongoDBとMongoidを初めて使用します。レガシ コードで、参照モデルにtype: Moped::BSON::ObjectId
とどこか の両方を使用している人々を見ました。type: String
例
class Team
include Mongoid::Document
field :room_id, type: String
field :leader_id, type: Moped::BSON::ObjectId
...
end
( git blame
I know these 2 lines written by 2 different people)
検索を行いましたが、いつ/なぜどのタイプを使用するのかという質問に対する答えが見つかりませんでした? String
またMoped::BSON::ObjectId
ありがとう、