Search code examples
jqueryrethinkdbadvertisement-server

How to store API in rethinkdb which is coming from ad server


How to store API in rethinkdb which is coming from ad server and widget. How can I store those in rethinkdb?


Solution

  • If you're using JavaScript, you can just insert a JavaScript object into RethinkDB. Just make sure to convert your API response into a JS object.

    var obj = { type: 'type', property: 'property' };
    r.table("api")
     .insert(obj)
     .run(conn, callback)
    

    Take a look at the documentation for insert.

    Keep in mind that you cant' interact with RethinkDB directly from the browser.