Added mongo query to request function