obj/src/persistence/MemoryPersistence.js
/**
     * Deletes data items that match to a given filter.
     *
     * This method shall be called by a public deleteByFilter method from child class that
     * receives FilterParams and converts them into a filter function.
     *
     * @param correlationId     (optional) transaction id to trace execution through call chain.
     * @param filter            (optional) a filter function to filter items.
     */
Deletes data items that match to a given filter.
This method shall be called by a public deleteByFilter method from child class that
receives FilterParams and converts them into a filter function.

@param correlationId     (optional) transaction id to trace execution through call chain.
Deletes data items that match to a given filter . This method shall be called by a public deleteByFilter method from child class that receives FilterParams and converts them into a filter function . @param correlationId ( optional ) transaction id to trace execution through call chain .
deleteByFilter(correlationId, filter) {
        return __awaiter(this, void 0, void 0, function* () {
            let deleted = 0;
            for (let index = this._items.length - 1; index >= 0; index--) {
                let item = this._items[index];
                if (filter(item)) {
                    this._items.splice(index, 1);
                    deleted++;
                }
            }
            if (deleted == 0) {
                return;
            }
            this._logger.trace(correlationId, "Deleted %s items", deleted);
            yield this.save(correlationId);
        });
    }
deleteByFilter ( correlationId , filter ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { let deleted = 0 ; for ( let index = this . _items . length - 1 ; index >= 0 ; index -- ) { let item = this . _items [ index ] ; if ( filter ( item ) ) { this . _items . splice ( index , 1 ) ; deleted ++ ; } } if ( deleted == 0 ) { return ; } this . _logger . trace ( correlationId , "Deleted %s items" , deleted ) ; yield this . save ( correlationId ) ; } ) ; }
Deletes data items that match to a given filter.
Deletes data items that match to a given filter .