Page 1 of 1

500 (Internal Server Error) when querying files collection

Posted: Thu Sep 29, 2016 7:48 pm
by Peter Perecz

Hi Team,

Could you pls support me in the following.

I am trying to query the files collection to get a list of files, which matches a given array.

It works perfectly when I use a dummy array in the query but returns 500 (Internal Server Error) when I try to use variable.

I have attached some screenshots;

Console.png - The array has values but I receive the failure code

Image

Query.png - The currently used query generates error. If I use the marked ones instead I have the wanted array displayed with no problem

Image

Thanks,
Peter


500 (Internal Server Error) when querying files collection

Posted: Fri Sep 30, 2016 7:49 am
by Serhii Kulibaba

Hello Peter,

1) Please be sure that variable is defined here (e.g. print it to the console)

2) Please use a simple json object in that request instead of the string value, e.g.:
return {"id":{"$in": $scope.base_line_filiIDs_to_read}};
instead of:
return '{"id":{"$in": '"+$scope.base_line_filiIDs_to_read+'"}}';


500 (Internal Server Error) when querying files collection

Posted: Fri Sep 30, 2016 8:31 am
by Peter Perecz

Works perfect, thanks a lot Sergiy