i am trying to work with Azure's DocumentDb to validate the user credentials for login but i am not able to get the proper result.
Some Points: 1. this is a partitioned collection and i am passing the partition key. 2. i am passing an array as parameter.
Here is my Code for calling the procedure:
response = await client.ExecuteStoredProcedureAsync<string>(storedProcedurelink, new RequestOptions { PartitionKey = new PartitionKey(partitionKey) }, new dynamic[]{param});
and here is my code for the procedure:
function sample(param) {
var collection = getContext().getCollection();
var query = 'SELECT * FROM c where c.logindata.email="'+param[0]+'" and c.logindata.password="'+param[1]+'" and c.userid>0';
// Query documents and take 1st item.
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
query,
function (err, feed, options) {
if (err) throw err;
if (!feed || !feed.length) getContext().getResponse().setBody('no docs found');
else getContext().getResponse().setBody(JSON.stringify(feed));
});
if (!isAccepted) throw new Error('The query was not accepted by the server.');
}
I am able to execute the query in the query explorer and get the proper result but when i call the procedure it always gives no docs found. I don't know what i am doing wrong, can someone point me in right direction.

