Chaining Promises in Mongodb without input arguments


#1

How can I chain Mongodb call in Promises but with an empty argument?

FutureTasks.find().forEach(function (details) {
    getAllMembersFromCollection()

       // convert from XML to json
      .then(txt => xml2JsonFunction(txt))

      // save to Mongo Collections
      .then(txt => jsonUpdateCollection(txt)) <-  

      .then(() => getNameFromCollection(details.userid)) 

<----> How to execute this when it is not taking input from jsonUpdateCollection
, since it is only (details.userid) as input to check Mongodb

async function jsonUpdateCollection(jsonString) {
    var promise = await new Promise(function (resolve, reject) {
        var contentObj = EJSON.parse(jsonString);
        contentObj["ns2:users"].User.forEach(user => {

            myTasks.upsert({
                name: user.name[0],
                id: user.id[0],
            }, {
                $set: {
                    identityGroupName: user.identityGroupName[0],
                    description: user.description[0],
                    created: user.created[0],
                    lastModified: user.lastModified[0],
                    lastPasswordChange: user.lastPasswordChange[0],
                }
            });  
        }, (err, db) => {
            err ? reject(err) : resolve(db);
        });  
 
    });
    return promise;