Saturday 27 June 2020

find all userIds from object -> array -> objects

Hi, i am having problem to find out user ids fromconst userIds ={ "request" :[{"name" : "xyz","_id" : ObjectId("5ef6ab2b9c4b893b540f0077"),"userId" : ObjectId("5ef6aa259c4b893b540f0069")},{"name" : "abc","_id" : ObjectId("5ef7feb8b2bf75221088dfd6"),"userId" : ObjectId("5ef6aa6e9c4b893b540f006e")}]}console.log(userIds.request[0]._id) ---> gives only first idbut i want userId from all object. Can i get help

Submitted June 28, 2020 at 04:10AM by Manisha_987

No comments:

Post a Comment