-
Notifications
You must be signed in to change notification settings - Fork 36
RemoveAll example not working #79
Comments
Your second example is right. Alternately, if you want to check the responses of the removeAll: messages.findAll({ from: 'bob' }, {from: 'agatha' }).fetch()
.map(messageList => messages.removeAll(messageList))
.subscribe({
next(removedId) { console.log(`id ${removedId} was removed`) },
error(err) { console.error(`Error removing items! ${err}`) },
complete() { console.log('All items removed successfully') },
}) |
@deontologician Would it fix the example at http://horizon.io/api/collection/#removeall to add a var messageList = messages.findAll({from: "bob"}, {from: "agatha"}).fetch().toArray(); |
No, |
Ah right, makes sense. So what you wrote here #79 (comment) is probably what we should put into the docs? |
Yeah, it's effectively the same as @rnenjoy's example, but is more general since it shows how to get the removed ids back out |
Hello,
Maybe im doing this the wrong way, but i tried the example:
I couldn't get this working since removeAll expects an object, and messageList seems to be just a snapshot? This is how I made it, but then again, i'm a n00b:
The text was updated successfully, but these errors were encountered: