Meteor collections have the ability to specify an option that determines what type of ID generation method is used to generate new IDs for documents in that collection. By default, a random string generation function is used if no option is specified.
With the random string generation method, everything works as intended when working with Iron-Router and :id parameters. When working with ObjectID, we have to convert the _id from and to each route using new Mongo.ObjectID() and toHexString().
I don't know how hard it is to implement, but it would be great if that conversion would be done by the Iron-Router package automatically.
Maybe define a global router option so that there is no runtime type checking overhead.
Meteor collections have the ability to specify an option that determines what type of ID generation method is used to generate new IDs for documents in that collection. By default, a random string generation function is used if no option is specified.
With the random string generation method, everything works as intended when working with Iron-Router and
:id
parameters. When working withObjectID
, we have to convert the_id
from and to each route usingnew Mongo.ObjectID()
andtoHexString()
.I don't know how hard it is to implement, but it would be great if that conversion would be done by the Iron-Router package automatically.
Maybe define a global router option so that there is no runtime type checking overhead.