Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwellRT.query error when first parameter in the string form contains a wave id #41

Closed
atfornes opened this issue Aug 4, 2015 · 2 comments

Comments

@atfornes
Copy link
Contributor

atfornes commented Aug 4, 2015

I expect the following two queries to be equivalent, however, the second produces an error, am I doing something wrong?:

  • parameter in JSON format:
  var id = 'local.net/s+VPmCWEf0GGA';
  SwellRT.query({'root.id': id}, function(res){console.log(JSON.stringify(res))})
  • parameter in string format:
  var id = 'local.net/s+VPmCWEf0GGA'
  SwellRT.query("{'root.id': " + id + "}", function(res){console.log(JSON.stringify(res))})

Last form produces the following error GET http://swellrt:9898/swell/model?q=%7B%27root.id%27%3A+local.net%2Fs%2BVPmCWEf0GGA%7D 500 (Server Error)

maybe the problem is related with escaped characters in the URL?

@pablojan
Copy link
Contributor

pablojan commented Aug 4, 2015

Not an issue. Add '' around the id var in the second expression.

@pablojan pablojan closed this as completed Aug 4, 2015
@atfornes
Copy link
Contributor Author

atfornes commented Aug 4, 2015

Thanks! the correct expression is:

("{'root.id': '" + id + "'}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants