Meteor.js : How to run check() when arguments are Mongodb ObjectId's?

Viewed 8489

In some of my Meteor methods, I'm sending Mongodb ObjectId's from the client as arguments. I'd like to run these through Meteor's check() system but I can't seem to find anything that matches successfully with them.

I've tried

var someObjectId = Meteor.Collection.ObjectId();

check(someObjectId, Meteor.Collection.ObjectId()) // fails
check(someObjectId, { _str : String }) //fails
check(someObjectId, String) //fails

any help much appreciated !

5 Answers
Related