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

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -