This is my sample javascript
code is being executed in node.js
let commutertrip = new Map();
let t = {
userId: 1,
capacity: 4,
commuteId: 1,
endTime: new Date(),
id: 1,
status: "QUEUED",
startTime: new Date(),
price: 100
};
commutertrip.set(1, t);
let trip = {
id: 2,
poolerId: 3,
poolerTrip: {
capacity: 4,
commuteId: 8,
id: 1,
endTime: new Date(),
startTime: new Date(),
status: "QUEUED",
price: 55,
userId: 1
},
commuterTrip: commutertrip,
status: "QUEUED"
};
console.log(JSON.stringify(trip));
The output
{"id":2,"poolerId":3,"poolerTrip":{"capacity":4,"commuteId":8,"id":1,"endTime":"2016-07-27T06:59:51.773Z","startTime":"2016-07-27T06:59:51.773Z","status":"QUEUED","price":55,"userId":1},"commuterTrip":{},"status":"QUEUED"}
I didn't find how to fix this? The same javascript
code works fine here
Here's the node arguments node --debug-brk=33172 --nolazy --harmony bin\www
Map
is serialisable. You must do that yourself, manually: 1. turn your map into a plain JS object 2. serialise it.