Don't use $where at all. If you want to query for birthdays in September, use aggregation and $month:
db.xxx.aggregate([
{ "$project" : { "birthMonth" : { "$month" : "$personalInfo.dateOfBirth" } } },
{ "$match" : { "birthMonth" : 9 } } // note $month returns dates with Jan = 1, not Jan = 0 like .getMonth
])
Ideally, you'd have a $match stage using an index at the start of the pipeline to avoid projecting the birthMonth field for every document. If this is a query you need to do all the time, I'd suggest adding a birthMonth field to the documents (and indexing it), so you can just write something like
db.xxx.find({ "personalInfo.birthMonth" : 9 })
-Will