nl_tokens: First pass : for some workflowGuids only some of the locales have a parkedId due to various catch - 22 s . Give them all a parkedId .
pl_tokens: function crossCorrectPass ( callback ) { return async . series ( [ find , correct ] , callback ) ; function find ( callback ) { return self . apos . docs . db . findWithProjection ( { parkedId : { $exists : 1 } } ) . toArray ( function ( err , _pages ) { if ( err ) { return callback ( err ) ; } pages = _pages ; return <mask> ( null ) ; } ) ; } function correct ( callback ) { var parkedIdsByWorkflowGuid = { } ; _ . each ( pages , function ( page ) { parkedIdsByWorkflowGuid [ page . workflowGuid ] = page . parkedId ; } ) ; return async . eachSeries ( _ . keys ( parkedIdsByWorkflowGuid ) , function ( workflowGuid , callback ) { return self . apos . docs . db . update ( { workflowGuid : workflowGuid } , { $set : { parkedId : parkedIdsByWorkflowGuid [ workflowGuid ] } } , { multi : true } , callback ) ; } , callback ) ; } }