如何访问Azure文档db node js TriggerType定义?

时间:2017-03-16 19:27:29

标签: azure azure-cosmosdb

当以下触发器上传到azure文档集时,我得到未定义的TriggerType:

'mytriggerTrigger': {
    id: 'triggerid',
    serverScript: function Foo() {
        // code omitted
    },
    triggerType: TriggerType.Pre,
    triggerOperation : TriggerOperation.Create
}

1 个答案:

答案 0 :(得分:0)

您需要导入DocumentBase对象,然后才能访问这些属性。

var documentdb = require('documentdb'),
DocumentClient = documentdb.DocumentClient,
DocumentBase = documentdb.DocumentBase;

'mytriggerTrigger': {
    id: 'triggerid',
    serverScript: function Foo() {
        // code omitted
    },
    triggerType: DocumentBase.TriggerType.Pre,
    triggerOperation : DocumentBase.TriggerOperation.Create
}