javascript - 如何从azure数据库的表中删除行?

标签 javascript windows azure windows-8 windows-store-apps

正在开发 Windows 商店 javascript 应用程序。该应用程序通过移动服务与 Azure 集成。我想删除与特定 ID 匹配的特定记录。

假设表(项目)中有四列(编号,名称,标题,消息,id)

我想删除 id=5 且 title='stackoverflow' 的整行。什么代码将执行该操作?

最佳答案

鉴于您引用了 table对象,您需要从表中获取实际行,然后只需调用 del(item, callback) table 对象上的方法。您可以从已检索的对象列表中获取实际行,或使用 where method得到它。

类似于:

var myTable = client.getTable('MyItem');
// here is a code to get the actual item
myTable.del(item);

或更简单的:

myTable.where({ id: 5, titile: "stackoverflow" })
    .read()
    .done(function (results) {
        var result = results[0];
        if (result != null && typeof (result) != "undefined") {
            todoTable.del(result);
        }
    });

关于javascript - 如何从azure数据库的表中删除行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15771237/

相关文章:

javascript - 如何运行 2 个 JavaScript 代码以获得正确的结果

javascript - 带有区域限制的 Angular 8 拖放

windows - windows平台的Qt打包

c# - Excel 互操作库无法在 Azure 上运行

Azure AD 应用程序权限 : Is it possible to get permissions which comes under "Other permissions granted for tenant"?

javascript - 单击子 td 时如何获取 th ?

javascript - 本地 href 不会在 WAMP 中进行鼠标悬停/悬停

java - 从文件位置在 Java 中运行 .exe 文件

c++ - Visual C++ 标准库关键字

python - 在 docker 镜像中安装 pyodbc