#How to set many elements in array of mongoose schema

1 messages · Page 1 of 1 (latest)

wanton oriole
#

so MongoDB library in NodeJS

#

right?

torpid turtle
#

i tried finding here but found nothing

torpid turtle
wanton oriole
#

you would need a prepare query to set multiple elements at once

#

else a for loop

#

generally in SQL

torpid turtle
#

can we just set an array like staff: ['1', '2', etc]

wanton oriole
#

in JPA you save a collection (List or Set)
and the library does the for loop

#

check the API for collections update/saving/insertion

#

if not you will need to do it one by one

#

hopefully prepared query or not