1

I am getting a strange error when attempting to use the $goQuery feature. Here is my code:

 var options = "{sort: null, limit: null}";
 var expr = "{userName: 'asdf'}";
 $scope.person = $goQuery('person',expr, options).$sync();

I'm getting the following error message:

Link to Error Message Image

I tried converting the vars to JSON.parse objects, but that didn't work either.

Rudy Hinojosa
  • 1,448
  • 14
  • 15

2 Answers2

1

Instead of passing the string literals, you need to pass the Objects themselves. In addition to this, you need to supply valid values for sort and limit. For example, using the code you posted:

var options = { sort: { 'userName': 'asc' }, limit: 5 };
var expr = {userName: 'asdf'};
$scope.person = $goQuery('person',expr, options).$sync();
stash
  • 176
  • 2
1

Ok, I got it to work. I tried the object direct versus the string:

$scope.person = $goQuery('person', { userName: $scope.person.findme }, { sort: { 'userName': 'asc' }, limit: 1 }).$sync();
Rudy Hinojosa
  • 1,448
  • 14
  • 15