如何在client.ExecuteStoredProcedureAsync()中执行此JS文件; 它不发送任何结果
function simple(UseID) {
var collection = getContext().getCollection();
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
"SELECT * FROM c where c.id='" + UseID +"'");
}
答案 0 :(得分:2)
您需要在queryDocuments()
的回调中设置存储过程响应。
例如:
function simple(UseID) {
var collection = getContext().getCollection();
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
"SELECT * FROM c where c.id='" + UseID + "'",
{},
function(err, documents, responseOptions) {
getContext().getResponse().setBody(documents);
});
}