none
Javascript Delete DocumentDbEntries by Binding RRS feed

  • Question

  • Hi there,

    i am trying to delte DocumentDB Data (CosmosDB)

    I already read the DB , Update the DB but how can i deltete items ?

    ive tried following :

    Array.prototype.multiIndexOf = function (eventDate) {
    var idxs = [];
    for (var i = this.length - 1; i >= 0; i--) {
    if (this[i].eventDate > eventDate) {
    idxs.unshift(i);
    }
    }
    return idxs;
    };
    module.exports = function (context, myTimer) {
    let expirationDate = new Date().addDays(-1);
    let items = context.bindings.doc.multiIndexOf(expirationDate.getTime());
    context.bindings.event = context.bindings.doc;
    items.forEach(function(element) {
    context.bindings.event.splice(element,1);
    }, this);
    context.done();
    };

    Ive also tried to filter the items and reatach them to the context. Nothing happens+

    doc is my InputCollection, event my Output.

    Any Ideas ?

    Wednesday, June 21, 2017 5:18 PM

Answers