これは初めての使用です。私は最近、新しいMicrosoft Azure App Serviceに移行したため、node.jsの構文などが変更されたか、少し違っているようです。これは古いモバイルサービスの私の現在のコードなので、私は新しい構文に移行したいと思っています。変更などの点では非常に限られた参考文献があり、私はGoogle上でもそれほど多く見つけることができませんでした。AzureモバイルアプリCRUD操作の構文
function insert(item, user, request) {
var table = tables.getTable('user');
table.where({
userid: item.userid
}).read({
success: upsertItem
});
function upsertItem(existingItems) {
if (existingItems.length > 0) {
item.id = existingItems[0].id;
table.update(item, {
success: function(updatedItem) {
request.respond(200, updatedItem)
}
});
} else {
request.execute();
}
}
}
私の目的はUPSERTを実行することで、新しいスクリプトのこのISAサンプル
var table = module.exports = require('azure-mobile-apps').table();
table.read(function (context) {
return context.execute();
});
IVEにも、この記事を見たが、
Azure mobile apps CRUD operations on SQL table (node.js backend)
その有用ではありません私の元のコードに従って。あなたが正確な変換を提供することによって私を助けることができるなら、それは私の好みの答えでしょう。
ご協力いただきありがとうございます。