I'm pretty new with Angular2, RethinkDB and Horizon API and I'm building a small webapp. In this app I'm trying to delete all objects in a specific table, and therefore I use the fetch() and removeAll() functions from Horizon API. The problem is the following error:
removeAll takes an array as an argument
The Horizon API's documentation is describing that the fetch() method returns an array, and I'm using this array to removeAll() data. Source: https://horizon.io/api/collection/#fetch
this.table.removeAll(this.table.fetch().subscribe(
result => console.log('Result:', result),
err => console.error(err),
() => console.log('Results fetched')
));
When I log the result of this fetch, it's displaying an array of Objects.
Result: [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
I've tried declaring an array earlier and many other things but nothing seems to work. Any idea's?