構成された型の配列があり、BSON::ObjectId
文字列としていくつかの ID と比較したい。
if my_array_of_BSON_ObjectIds.include?(@my_id_as_a_string)
# delete the item from the array
else
# add the item to the array as a BSON::ObjectId
end
タイプが異なるため、これは機能しません。文字列を に変換できBSON::ObjectId
ますか? もしそうなら、どのように?