In my client-side code, I called getContents():
$.getJSon("/getContents", function(room){
theRoom=$("#roomName").val();//textarea's value
...
});
In getContents(), which is in the server-side code(index.js), how can I use request.query or any other function to get theRoom(variable) so that I can get the contents of a Room based on its title(theRoom)?
getContents();
var getContents=function(req,res){
...
var room=?
...
roomCollection.findOne({name: room}, function(err,theRoom){...
res.send(theRoom)
});
...
}