How to push value into array?

39 views
Skip to first unread message

Ron June Valdoz

unread,
Mar 6, 2022, 8:58:00 PM3/6/22
to kmongo

zigzago

unread,
Mar 7, 2022, 12:50:41 AM3/7/22
to kmongo

Try

categoryCol.updateOneById( ObjectId(courseInput.categoryId), "{$push: { courses: result.insertedId!!.asObjectId().json }}" )

(if your _id is of type ObjectId)
Le lundi 7 mars 2022 à 02:58:00 UTC+1, ronjun...@gmail.com a écrit :
 https://github.com/Litote/kmongo/issues/326

Reply all
Reply to author
Forward
0 new messages