Mongodb Size Of Array In Javascript Functions