how to get "automatically generated IDs" in bulkCreate

1,226 views
Skip to first unread message

Muddy Dixon

unread,
Jun 4, 2014, 10:53:31 PM6/4/14
to sequ...@googlegroups.com
Hi,

I use bulkCreate but i cannot get "automatically generated IDs" of instances as described in document.

How can i get this fields without other unique fields like uuid?

findAll: it returns all items and i cannot get "last insert ids" without query

or how can i get conditions that enables me to get last insert items.

Muddy




Muddy Dixon

unread,
Jun 4, 2014, 10:58:31 PM6/4/14
to sequ...@googlegroups.com
Oops,

I got to resolve it.

with Option `hooks: true`.

Mick Hansen

unread,
Jun 5, 2014, 3:03:04 AM6/5/14
to Muddy Dixon, sequ...@googlegroups.com
It's generally not possible to get generated id's for bulkCreate since it will use a single insert in most cases (apparently hooks: true works around this as you've discovered, but that might change in master).
--
Mick Hansen
@mhansendev
mhansen.io
Reply all
Reply to author
Forward
0 new messages