Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert string array to objectid mongoose

let objectIdArray = stringObjectIdArray.map(s => mongoose.Types.ObjectId(s));
//or
let objectIdArray = stringObjectIdArray.map(mongoose.Types.ObjectId);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #string #array #objectid #mongoose
ADD COMMENT
Topic
Name
1+5 =