I think that it will not be so simple (at the moment), because the Meteor kernel must somehow support this function.
So, Meteor.findOne()
returns a simple JavaScript object, and Meteor.find().fetch()
returns a JavaScript array. Perhaps you can try the example from Flow | Objects
Flow | Objects
docs:
type Book = { name: string, author: string, price: number }; const book = Meteor.books.findOne(id); //returns { name : 'Flowtype Handbook', author: 'renren89', price: 'free'} ( book : Book );
But, as you can see, Meteor must first return data at application startup, so this example is really useful.
Another option is to use third-party packages to validate the collection against the schema. There are two packages of competitors:
Perhaps this solution is better than using Flowtype
source share