I need to create an array from JSON data in node.js. I dont want to use jquery selector for this.
data = { List : ['1' , '2' , '3'] }
I am sending this data in the ajax call (POST). At the server end receving is:-
reqArray = req.param('List');
reqArray contains:- ['1' ,'2' ,'3']
I need this reqArray
as an input to $in
in mongoDb
,where it takes array as as input.
In the format [1 ,2 , 3]
please suggest a way of doing this.