Peter Perecz
Posts: 0
Joined: Sun Feb 01, 2015 9:02 pm

500 (Internal Server Error) when querying files collection

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

500 (Internal Server Error) when querying files collection

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+'"}}';

Peter Perecz
Posts: 0
Joined: Sun Feb 01, 2015 9:02 pm

500 (Internal Server Error) when querying files collection

Works perfect, thanks a lot Sergiy

Return to “Issues”