Azure Mobile Client,如何在Angular 4中进行批量插入?

时间:2017-07-15 10:26:35

标签: performance angular azure

我目前正在使用js库:

<script src="//zumo.blob.core.windows.net/sdk/azure-mobile-apps-client.2.0.0.js"></script>

我目前正在尝试进行批量插入而不是foreach。有没有方法调用,我可以使用吗?

addSubjectSpecialization(specialization): Promise<any>{
        var orderTable = this.client.getTable("specialization");
        return new Promise((resolve, reject) => {
            orderTable.insert(specialization).then((res) => {
                resolve(res);
            }, (err) => reject(err))
        })
    }

在我的组件中,我正在做一个foreach,插入多个对象。有没有更好的方法?这意味着:我们是否具有批量插入功能而不是foreach?

参考:https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-html-how-to-use-client-library#inserting 注意:我已经看到了Stackoverflow提供的建议。没有人能解决这个问题。 MobileClient(.Net)具有tableStorage批量插入的建议。我不知道怎么能用打字稿来做。

1 个答案:

答案 0 :(得分:0)

目前,我们无法使用批量插入功能。但您可以在this Github repository上发布功能请求。