Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "_id" : ObjectId("5caf2c1642e3731464c2c79d"),
- "requested" : [],
- "roomNo" : "E0-1-09",
- "capacity" : 40,
- "venueType" : "LR(M)",
- "seatingType" : "TB",
- "slotStart" : "8:30AM",
- "slotEnd" : "9:50AM",
- "__v" : 0
- }
- /* 2 */
- {
- "_id" : ObjectId("5caf2deb4a7f5222305b55d5"),
- "requested" : [],
- "roomNo" : "E0-1-09",
- "capacity" : 40,
- "venueType" : "LR(M)",
- "seatingType" : "TB",
- "slotStart" : "10:00AM",
- "slotEnd" : "11:20AM",
- "__v" : 0
- }
- [{ roomNo: "E0-1-09" , availability : [{slotStart : "8:30AM", slotEnd: "9:50AM"} ,
- {slotStart: "10:00AM", slotEnd : "11:20AM"}]
- db.getDB().collection(collection).aggregate([
- { $group: {_id:{roomNo: "$roomNo", availability :[{slotStart:"$slotStart", slotEnd:"$slotEnd"}]}}}
- ])
- [{ roomNo: "E0-1-09" , availability : [{slotStart : "8:30AM", slotEnd: "9:50AM"}]
- [{ roomNo: "E0-1-09" , availability : [{slotStart: "10:00AM", slotEnd : "11:20AM"}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement