How can separated my ObjectID? (using mongodb especially in relationships)

enter image description hereMy ObjectID has seperated like in Command Prompt like this one

 "tchStudents" : [
            ObjectId("616450eeecf687bc5f59fac2"),
            ObjectId("61645108ecf687bc5f59fac4"),
            ObjectId("616451a8ecf687bc5f59fac8")
 ]

but if we fetch the data and display on the browser, it just like this

616450eeecf687bc5f59fac261645108ecf687bc5f59fac4616451a8ecf687bc5f59fac8

Can I use .split or .slice Thank you for helping out

Answer

use match with /.{1,24}/g regex

let str = "616450eeecf687bc5f59fac261645108ecf687bc5f59fac4616451a8ecf687bc5f59fac8"
let arr = str.match(/.{1,24}/g);
console.log(arr);