Вы можете использовать инструкцию where для построения любого скрипта JS:
db.myCollection.find( { $where: "this.name.toLowerCase().indexOf('m') >= 0" } );
Ссылка: http://docs.mongodb.org/manual/reference/operator/where/