Hi guys,
I'm using collection.models to iterate on the models after fetchAll().
Since it's not in the documentation, could there be a problem or is it safe to use ?
Thanks !
Hi @Titozzz
I would suggest you to use the standard way that Bookshelf provides. All collections are populated with a list of lodash methods. The full list of lodash methods are also documented.
So you could easily do:
collection.map(function(model) {
// perform mapping operation
})
Thank you very much,
Will update my code then :smile:
@vellotis
Most helpful comment
Hi @Titozzz
I would suggest you to use the standard way that Bookshelf provides. All collections are populated with a list of
lodashmethods. The full list of lodash methods are also documented.So you could easily do: