I am creating a todo application and I would like each todo list to have a unique name. Each user has an array of todo lists. An incoming POST request to create a new list has the user object attached to it so I can get the array using `const userLists = req.user.list`. This (if I console log it) is each list `_id`.

I am trying to loop through these to get the list object and test the name to see if it equals `req.body.name` to ensure uniqueness. 

I would prefer to keep the function `async` as I have more logic below and would prefer not to nest too many callback functions.

I have tried 

```
exports.createList = async (req, res) => {
const usersLists = req.user.lists;
  let proms = [];
  let found = false;
userLists.map(list => {
const listObj = List.findOne({_id : list});
if(listObj.name === req.body.name)
   found = true
})
(other code below to create list)

```

and also tried to `await List.findOne()` but i can't `async` the map.

I believe the code is running past this and so `found` is never true.

I then saw something online that used `Promise.all()` and so i tried this:

```
let proms = []
usersLists.map(listId => {
    proms.push(List.findOne({_id: listId}, "name").exec());
  });
await Promise.all(proms.map(p => {
  if(p.name == req.body.name)
    found = true;
}))

```

but the code below still runs and the list is created. If i `console.log(proms)` then it consists of an array of [object Promise].

It is still fairly new to me and all I am trying to do is loop through an Array of List id's, get the list object and test to see if any of the list names is equal to the name of the new list I want to create (and return an error)

Any help would be appreciated. Thanks