今日が誕生日のユーザーを返す MongoDB クエリを作成しているので、$where ステートメントで次の JS 関数を作成しました。
function() {
if (! this.birthday.getMonth) {return false;}
return this.birthday.getMonth() == 1
&& this.birthday.getDate() == 1
}
残念ながら、誕生日フィールドがドキュメントに設定されていない場合、エラーが発生するため、if ステートメントは機能していないようです。
JS Error: TypeError: this.birthday has no properties nofile_18
どんな助けでも大歓迎です。