2017-10-31 2 views
1

(https://github.com/Azure/azure-documentdb-js-server/blob/master/samples/stored-procedures/bulkDelete.js)에 저장된 proc을 실행하고 싶습니다. 이를 실행하려면 쿼리를 매개 변수로 전달해야합니다. 내 쿼리는 'SELECT VALUE (c._self) FROM c where c._ts < ='+ (새 날짜())와 같습니다. setFullYear (새 날짜(). getFullYear() - 1))/1000.Cosmos DB 스크립트 탐색기에서 저장 프로 시저에 대한 매개 변수로 쿼리를 전달하는 방법

위의 쿼리를 매개 변수로 전달하여 sp (링크에서 언급 함)를 실행할 때 throw되는 예외입니다. sp는 매개 변수로 위의 쿼리를 받아들이지 않기 때문에 함수 계산이 일부 필요합니다.

아무도 나에게 위의 쿼리를 매개 변수로 전달할 수있는 방법을 제안 할 수 있습니까?

+0

실제 오류 메시지는 무엇입니까? –

답변

0

질문에 표시되는 "큰 따옴표"가 필요하므로 누락되었습니다.

자세한 내용은 다음과 같습니다 :

는 당신이 필요로하는 것은 "스크립트 탐색기"예를 들어

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 

입니다 :
1. 처음 2 건 실패

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} 

그래서 때문에이 따옴표가 없거나 작은 따옴표가 있습니다.
2. 큰 따옴표가 있기 때문에 3 번째로 통과했습니다.

희망이 있습니다.

관련 문제