我想在(https://github.com/Azure/azure-documentdb-js-server/blob/master/samples/stored-procedures/bulkDelete.js )中执行存储的proc。要执行此操作,必须将query作为参数传递。我的查询类似于'SELECT VALUE(c._self) FROM c Where c._ts <='+(new Date().setFullYear(new Date().getFullYear() - 1))/1000。
当我通过传递上面的查询作为参数来执行上面的sp(链接中提到的)时,它抛出了异常。因为sp不接受上面的查询作为参数,这是因为它有一些函数计算。
有没有人能建议我如何将上述查询作为参数传递。
发布于 2017-11-28 07:16:11
因为它需要“双引号”,这是缺失的,如你的问题所示。
更多详细信息如下:
你需要的是“脚本资源管理器”
All explorers in document db are:
"Data Explorer"
"Document Explorer"
"Query Explorer"
"Script Explorer"
Click on "Script Explorer" (scroll down, it will be below "Data Explorer")
select Database on right
select Collection on right
then Stored Procedure you want to execute
then on the right there is:
"Inputs"
give your query like here
"Results"
see detailed error here
例如:
Inputs:
SELECT c._self FROM c
Results:
Invalid inputs. Please ensure that the "Inputs" field contains a valid JSON value.
Inputs:
'SELECT c._self FROM c'
Results:
Invalid inputs. Please ensure that the "Inputs" field contains a valid JSON value.
Inputs:
"SELECT c._self FROM c"
Results:
{"deleted":5,"continuation":false}
所以,
由于没有引号而导致
希望这能有所帮助。
https://stackoverflow.com/questions/47031436
复制相似问题