mongodb集計を使用して、必要に応じて正確な出力を取得できます
Account..aggregate([
{$match:{'buildings.gateways.devices.verificationCode':"4146"}},
{$unwind:"$buildings"},
{$unwind:"$buildings.gateways"},
{$unwind:"$buildings.gateways.devices"},
{$match:{'buildings.gateways.devices.verificationCode':"4146"}}
])