Eksportér (0) Udskriv
Udvid alt
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

Modify the request

Updated: April 2, 2014

In a JavaScript backend mobile service, scripts are used to modify read, insert, and update requests sent to Windows Azure Mobile Services before they are executed.

For example, the following insert script modifies the item being inserted by setting a createdAt timestamp property before calling execute.

function insert(item, user, request) {
    item.createdAt = new Date();
    request.execute();
}

The following read script extends the requested query by adding an additional filter clause before calling execute.

function read(query, user, request) {
query.where({ archived: false });
request.execute();
}

For more information, see the Mobile Services script reference

Vis:
© 2014 Microsoft