Start a new topic

Custom Data link with querystrings

I have a custom data link that I can pass url querystring parameters to and get my data. When I use the Kinvey library for accessing that, how can I pass those parameters?



Do I still create a query?



var query = new Kinvey.Query();

query.equalTo('top', 20);



Kinvey.DataStore.find('myDatalink', query, { etc...



Thanks,

Rich
1 Comment

Rich,



You pass all query parameters to your data link using the normal library query interface (see http://devcenter.kinvey.com/ios/guides/external-data-sources#Parameterpassing).



On the data link side the query is passed via a querystring parameter called "query" which is a JSON object.



In the example that you use above the data link connecter will have a query string of:

?query={"top": 20}



If you're trying this out in the API console, make sure that your collection ('myDatalink') has a trailing '/' before the query string (the libraries take care of this for you).
Login or Signup to post a comment