This is incorrect, Mongo has supported the $where operator since 2.2 (likely earlier, but the docs don’t go back that far anymore) and Meteor has bundled mongo 2.2 or above since launch in 2012.
I just tested with 1.8.1 and it works perfectly:
> test = new Mongo.collection('test')
> test.insert({message: 'abcdefghijklmnop'})
> test.find({$where: 'function(){ return this.message.length > 3}'}).fetch()
[ { _id: 'GcggX4tS8jT6CyB5Q', message: 'abcdefghijklmnop' } ]
> test.find({$where: 'function(){ return this.message.length < 3}'}).fetch()
[]
Meteor bundles the best supported version of Mongo with each version of Meteor.
Which is Mongo 4.0.6 for Meteor 1.8.1
What @menewman meant here is if this.message is sometimes undefined (thus throwing an error when trying to access length) just test for the existence of message:
YourCollection.find({
$where: 'function() { return this.message && this.message.length < 100 }'
})