node.js - Try to Intersect JSON Array -


i need intersect query result. after intersection data want use in page.

this data : (i store data in variable "hasilget")

[     {         "_id" : "2017-05-22",         "kamar" : [             [                 {                     "_id" : objectid("570f5095c8dbf1045d7fe9b3"),                     "namkam" : "vip one",                     "idtipe" : objectid("57023e5e36b35501f17ea5c6")                 }             ],             [                 {                     "_id" : objectid("570f509dc8dbf1035d7fe9b5"),                     "namkam" : "vip two",                     "idtipe" : objectid("57023e5e36b37601f17ea5c6")                 }             ]         ]     },      {         "_id" : "2017-05-23",         "kamar" : [             [                 {                     "_id" : objectid("570f5095c8dbf1045d7fe9b3"),                     "namkam" : "vip one",                     "idtipe" : objectid("57023e5e36b35501f17ea5c6")                 }             ]         ]     } ] 

i have try use "array-intersection" npm.

var inter = intersection(hasilget); console.log("hasil "+json.stringify(inter)); 

but problem output still result. intersection function not working.

please guide me.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -