On querying my mongodb collection, I am getting the following output:
var test =[{"_id":"54075a2f4cb76dee03052bfa","Pincode":700065,"Country":"India","City":"Kolkata","RoomId":"Bedroom","HomeId":"Mysweethome","MACID":"imp","UUID":"54075954706221ea0389289f","__v":0}]
However, when I try to access each key-value pair individually using test._id, the output comes out to be undefined! What is the mistake that I'm making?
test is an Array of objects. You need to loop through them or access them by index: test[0]._id.