Database
[{"_id":"17tegruebfjt73efdci342132","name":"Test User1","obj":"health=8,type=warrior"},{"_id":"wefewfefh32j3h42kvci342132","name":"Test User2","obj":"health=6,type=magician"}]
Query
db.collection.find({/** use the index on obj to potentially speed up the query*/"obj":/health=\d+/,//nowapplyafunctiontonarrowdownanddothemath$where:function(){vari=this.obj.indexOf("health=")+7;vars=this.obj.substring(i);varm=s.match(/\d+/);if(m)returnparseInt(m[0])>6;returntrue;}})