sql >> Database >  >> NoSQL >> MongoDB

Async gebruiken met MongoDb om incassodocumenten in volgorde in te vullen

uw insertRowInBLD functie moet een Promise teruggeven instantie in plaats van undefined als nu. Async.series wordt een array doorgegeven van undefined .

Dit.

function fillBLD() {
    async.series(
        [
            insertRowInBLD('R01', 'Disclosure of data due to deliberate action by internal actor', 'E. Not significant', 'Partially effective', 'Low', '', '', '', ''),
            insertRowInBLD('R02', 'Corruption of data due to deliberate action by internal actor', 'E. Not significant', 'Partially effective', 'Low', '', '', '', ''),
            insertRowInBLD('R03', 'Unavailability of data due to deliberate action by internal actor', 'E. Not significant', 'Partially effective', '', '', '', '', ''),
            insertRowInBLD('R04', 'Disclosure of data due to attack of the communications link by internal/external actor', 'E. Not significant', 'Partially effective', 'Low', '', '', '', ''),
            insertRowInBLD('R05', 'Corruption of data due to attack of the communications link by internal/external actor', 'E. Not significant', 'Partially effective', 'Low', '', '', '', ''),
        ]
    );
}

is dit eigenlijk.

function fillBLD() {
    async.series(
        [
            undefined,
            undefined,
            undefined,
            undefined,
            undefined
        ]
    );
}



  1. server instance pool is vernietigd

  2. MongoDB $pullAll

  3. MongoDB $rtrim

  4. Volgorde van antwoorden op MongoDB $in query?