Dear attempts to filter by date in mongo but I have not succeeded. I pass my query and structure of JSON.
db.getCollection('articles').aggregate([
{ "$match": {
"$expr": {
"$and": [
{
"$gte": [
{ "$dateFromString": { "creationDate": "10-08-2018", "format": "%m-%d-%Y" }}
]
},
{
"$lte": [
{ "$dateFromString": { "creationDate": "10-08-2018", "format": "%m-%d-%Y" }}
]
}
]
}
}}
])
My JSON is
{
"_id" : ObjectId("5bbb6b1de75b933850a608fc"),
"title" : "05",
"body" : "asgfasgasfa",
"creationDate" : ISODate("2018-10-08T14:35:07.000Z"),
"operationType" : "C",
"__v" : 0
}
MongoDB : v3.6.3
If you a looking for a match on "10-08-2018" exactly from a date field you can use $dateToString in combination with $eq:
db.getCollection('articles').aggregate([
{
"$match": {
"$expr": {
$eq: [
"10-08-2018",
{
"$dateToString": {
"date": "$creationDate",
"format": "%m-%d-%Y"
}
}
]
}
}
}
])
See it working here
If you are looking for a set of records matching a date range:
db.getCollection('articles').aggregate([
{
"$match": {
"$expr": {
"$and": [
{
"$gte": [
"$creationDate",
{
"$dateFromString": {
"dateString": "10-08-2018",
"format": "%m-%d-%Y"
}
}
]
},
{
"$lte": [
"$creationDate",
{
"$dateFromString": {
"dateString": "11-08-2018",
"format": "%m-%d-%Y"
}
}
]
}
]
}
}
}
])
See it working here
One note with the 2nd example is that it would do the dates as ISO date so it would not cover the end of day 11-08-2018 but 2018-11-08T00:00:00.000Z as pointed out by matthPen comment.
Even if #Akrion answer is returning sample, it not properly filter dates. In a global way, it's better to deal with dates as often as you can, instead of transforming to string. A simple example : using your format ("%m-%d-%Y"), Date("10-08-2018") > Date("12-01-2017"), but in term of string comparison, "10-08-2018" < "12-01-2017" . The only working format in this case is %Y-%m-%d .
Anyway, mongoDB provides some operators in aggregation framework, to properly work with dates. Here's a query to match by day :
db.collection.aggregate([
{
$match: {
$expr: {
$and: [
{
$eq: [
{
$year: new Date("2018-10-08")
},
{
$year: "$creationDate"
}
]
},
{
$eq: [
{
$month: new Date("2018-10-08")
},
{
$month: "$creationDate"
}
]
},
{
$eq: [
{
$dayOfMonth: new Date("2018-10-08")
},
{
$dayOfMonth: "$creationDate"
}
]
}
]
}
}
}
])
You can try it here
It can be a little more tricky to adapt this query for dates range, but the following query will do the job. You can test it here.
db.collection.aggregate([
{
$match: {
$expr: {
$and: [
{
// Start date definition, included ($gte)
$or: [
{
$and: [
{
$eq: [
{
$year: new Date("2018-10-08")
},
{
$year: "$creationDate"
}
]
},
{
$eq: [
{
$month: new Date("2018-10-08")
},
{
$month: "$creationDate"
}
]
},
{
$gte: [
{
$dayOfMonth: "$creationDate"
},
{
$dayOfMonth: new Date("2018-10-08")
}
]
}
]
},
{
$and: [
{
$eq: [
{
$year: "$creationDate"
},
{
$year: new Date("2018-10-08")
}
]
},
{
$gte: [
{
$month: "$creationDate"
},
{
$month: new Date("2018-10-08")
}
]
},
]
},
{
$and: [
{
$gte: [
{
$year: "$creationDate"
},
{
$year: new Date("2018-10-08")
}
]
},
]
}
],
},
//end date definition, excluded ($lt)
{
$or: [
{
$and: [
{
$eq: [
{
$year: new Date("2018-11-08")
},
{
$year: "$creationDate"
}
]
},
{
$eq: [
{
$month: new Date("2018-11-08")
},
{
$month: "$creationDate"
}
]
},
{
$lt: [
{
$dayOfMonth: "$creationDate"
},
{
$dayOfMonth: new Date("2018-11-08")
}
]
}
]
},
{
$and: [
{
$eq: [
{
$year: "$creationDate"
},
{
$year: new Date("2018-10-08")
}
]
},
{
$lt: [
{
$month: "$creationDate"
},
{
$month: new Date("2018-11-08")
}
]
},
]
},
{
$and: [
{
$lt: [
{
$year: "$creationDate"
},
{
$year: new Date("2018-11-08")
}
]
},
]
}
],
}
]
}
}
}
])
Related
I have a collection of restaurant documents in my MongoDB database with an hours field having the format below.
How can I check if a restaurant is open now using MongoDB aggregation?
My hours field has data like this (with french days):
{
"Lundi": [
"08:00",
"23:00"
],
"Mardi": [
"08:00",
"23:00"
],
"Mercredi": [
"08:00",
"23:00"
],
"Jeudi": [
"08:00",
"23:00"
],
"Vendredi": [
"08:00",
"23:00"
],
"Samedi": [
"08:00",
"23:00"
],
"Dimanche": [
"08:00",
"23:00"
]
}
Query
uses the system variable "$$NOW" to get the current time of server
converts each day open hours into a minutes range(to work on minutes also)
open = 01:00 close = 02:30 limits=[60,150]
if current hour is 01:30 then min-now=90
and then filters day=dayNow min-now inside the limits
(for example in our example case 90 is in the limit [60,150])
if at least 1 passed the filter store is open, else closed
Test code here
Query
aggregate(
[{"$project":{"_id":0}},
{"$project":
{"open":
{"$filter":
{"input":
{"$map":
{"input":{"$objectToArray":"$$ROOT"},
"in":["$$this.k", "$$this.v"]}},
"cond":
{"$let":
{"vars":
{"info":
{"day":{"$arrayElemAt":["$$r", 0]},
"limits":
[{"$add":
[{"$multiply":
[{"$toInt":
{"$arrayElemAt":
[{"$split":
[{"$arrayElemAt":[{"$arrayElemAt":["$$r", 1]}, 0]},
":"]},
0]}},
60]},
{"$toInt":
{"$arrayElemAt":
[{"$split":
[{"$arrayElemAt":[{"$arrayElemAt":["$$r", 1]}, 0]},
":"]},
1]}}]},
{"$add":
[{"$multiply":
[{"$toInt":
{"$arrayElemAt":
[{"$split":
[{"$arrayElemAt":[{"$arrayElemAt":["$$r", 1]}, 1]},
":"]},
0]}},
60]},
{"$toInt":
{"$arrayElemAt":
[{"$split":
[{"$arrayElemAt":[{"$arrayElemAt":["$$r", 1]}, 1]},
":"]},
1]}}]}],
"day-now":
{"$arrayElemAt":
[["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi",
"Samedi", "Dimanche"],
{"$subtract":[{"$dayOfWeek":"$$NOW"}, 1]}]},
"min-now":
{"$add":
[{"$multiply":[{"$hour":"$$NOW"}, 60]},
{"$minute":"$$NOW"}]}}},
"in":
{"$and":
[{"$eq":["$$info.day", "$$info.day-now"]},
{"$gte":
["$$info.min-now", {"$arrayElemAt":["$$info.limits", 0]}]},
{"$lte":
["$$info.min-now",
{"$arrayElemAt":["$$info.limits", 1]}]}]}}},
"as":"r"}}}},
{"$project":{"open":{"$ne":["$open", []]}, "date-now":"$$NOW"}}])
Really an ugly data model. You have to translate french day names into number and the time values into Date objects. Then you can filter by day and times:
db.collection.aggregate([
{ $unset: "_id" },
{
$project: {
opening_times: {
$map: {
input: { $objectToArray: "$$ROOT" },
in: {
day: {
$switch: {
branches: [
{ case: { $eq: ["Lundi", "$$this.k"] }, then: 1 },
{ case: { $eq: ["Mardi", "$$this.k"] }, then: 2 },
{ case: { $eq: ["Mercredi", "$$this.k"] }, then: 3 },
{ case: { $eq: ["Jeudi", "$$this.k"] }, then: 4 },
{ case: { $eq: ["Vendredi", "$$this.k"] }, then: 5 },
{ case: { $eq: ["Samedi", "$$this.k"] }, then: 6 },
{ case: { $eq: ["Dimanche", "$$this.k"] }, then: 7 }
]
}
},
open: {
$dateFromParts: {
year: { $year: "$$NOW" }, month: { $month: "$$NOW" }, day: { $dayOfMonth: "$$NOW" },
hour: { $toInt: { $first: { $split: [{ $first: "$$this.v" }, ":"] } } },
minute: { $toInt: { $last: { $split: [{ $first: "$$this.v" }, ":"] } } },
timezone: "Europe/Paris"
}
},
close: {
$dateFromParts: {
year: { $year: "$$NOW" }, month: { $month: "$$NOW" }, day: { $dayOfMonth: "$$NOW" },
hour: { $toInt: { $first: { $split: [{ $last: "$$this.v" }, ":"] } } },
minute: { $toInt: { $last: { $split: [{ $last: "$$this.v" }, ":"] } } },
timezone: "Europe/Paris"
}
}
}
}
}
}
},
{
$project: {
open_today: {
$first: {
$filter: {
input: "$opening_times",
cond: { $eq: ["$$this.day", { $isoDayOfWeek: "$$NOW" }] }
}
}
}
}
},
{
$project: {
restaurant: {
$cond: {
if: {
$and: [
{ $gte: ["$$NOW", "$open_today.open"] },
{ $lt: ["$$NOW", "$open_today.close"] },
]
},
then: "open",
else: "close"
}
}
}
}
])
See Mongo playground
I have 3 table users,shifts,temporaryShifts,
shifts:[{_id:ObjectId(2222),name:"Morning"},{_id:ObjectId(454),name:"Night"}]
users:[{_id:ObjectId(123),name:"Albert",shift_id:ObjectId(2222)}]
temporaryShifts:[
{_id:2,userId:ObjectId(123),shiftId:ObjectId(454),type:"temporary",date:"2020-02-01"},
{_id:987,userId:ObjectId(123),shiftId:ObjectId(454),type:"temporary",date:"2020-02-03"},
{_id:945,userId:ObjectId(123),shiftId:ObjectId(454),type:"temporary",date:"2020-02-08"},
{_id:23,userId:ObjectId(123),shiftId:ObjectId(454),date:"2020-02-09"}]
i want to make a mongoose aggregate query then give me result :
get result between two dates for example :2020-02-01 2020-02-05,
resullts is :
[
{_id:ObjectId(123),name:"Albert",shift:[
{_id:2,shiftId:ObjectId(454),type:"temporary",date:"2020-02-01"},
{_id:2,shiftId:ObjectId(2222),type:"permanent",date:"2020-02-02"},
{_id:2,shiftId:ObjectId(454),type:"temporary",date:"2020-02-03"},
{_id:2,shiftId:ObjectId(2222),type:"permanent",date:"2020-02-04"},
{_id:2,shiftId:ObjectId(2222),type:"permanent",date:"2020-02-05"},
]}
]
in result type temporary mean selected date in table temporaryShift document available else type permanent
MongoPlayGround You Can edit
You can first project a date range array using $range, in your example it will be like [2020-02-01, 2020-02-02, 2020-02-03, 2020-02-04, 2020-02-05], then you can use the array to perform $lookup
db.users.aggregate([
{
$limit: 1
},
{
"$addFields": {
"startDate": ISODate("2020-02-01"),
"endDate": ISODate("2020-02-05")
}
},
{
"$addFields": {
"dateRange": {
"$range": [
0,
{
$add: [
{
$divide: [
{
$subtract: [
"$endDate",
"$startDate"
]
},
86400000
]
},
1
]
}
]
}
}
},
{
"$addFields": {
"dateRange": {
$map: {
input: "$dateRange",
as: "increment",
in: {
"$add": [
"$startDate",
{
"$multiply": [
"$$increment",
86400000
]
}
]
}
}
}
}
},
{
"$unwind": "$dateRange"
},
{
"$project": {
"name": 1,
"shiftId": 1,
"dateCursor": "$dateRange"
}
},
{
"$lookup": {
"from": "temporaryShifts",
"let": {
dateCursor: "$dateCursor",
shiftId: "$shiftId"
},
"pipeline": [
{
"$addFields": {
"parsedDate": {
"$dateFromString": {
"dateString": "$date",
"format": "%Y-%m-%d"
}
}
}
},
{
$match: {
$expr: {
$and: [
{
$eq: [
"$$dateCursor",
"$parsedDate"
]
}
]
}
}
}
],
"as": "temporaryShiftsLookup"
}
},
{
"$unwind": {
path: "$temporaryShiftsLookup",
preserveNullAndEmptyArrays: true
}
},
{
$project: {
shiftId: 1,
type: {
"$ifNull": [
"$temporaryShiftsLookup.type",
"permanent"
]
},
date: "$dateCursor"
}
}
])
Here is the Mongo Playground for your reference.
I am having issues with referencing a nested array item in a $cond statement.
db.getCollection('bookings').aggregate([
{
$lookup: {
from: "listings",
localField: "listingId",
foreignField: "_id",
as: "listing"
}
},
{
$match: {
$and: [
{
locationId: ObjectId("5c0f0c882fcf07fb08890c27")
},
{
$or: [
{
$and: [
{
state: "booked"
},
{
startDate: {
$lte: new Date()
}
},
{
startDate: {
$gte: ISODate("2019-12-18T07:00:00.000Z")
}
}
]
},
{
$and: [
{
listing: {
$elemMatch: {
inspectionStatus: "none"
}
}
},
{
endDate: {
$lte: new Date()
}
},
{
endDate: {
$gte: ISODate("2019-12-18T07:00:00.000Z")
}
},
{
state: {
$in: [
"active",
"returned"
]
}
}
]
},
{
$and: [
{
state: {
$ne: "cancelled"
}
},
{
$or: [
{
$and: [
{
startDate: {
$gte: ISODate("2019-12-20T07:00:00.993Z")
}
},
{
startDate: {
$lte: ISODate("2019-12-21T06:59:59.999Z")
}
}
]
},
{
$and: [
{
endDate: {
$gte: ISODate("2019-12-20T07:00:00.993Z")
}
},
{
endDate: {
$lte: ISODate("2019-12-21T06:59:59.999Z")
}
}
]
}
]
}
]
}
]
}
]
}
},
{
$addFields: {
isLate: {
$cond: [
{
$or: [
{
$and: [
{
$eq: [
"$listing.0.inspectionStatus",
"none"
]
},
{
$lte: [
"$endDate",
new Date()
]
},
{
$gte: [
"$endDate",
ISODate("2019-12-18T07:00:00.000Z")
]
},
{
$in: [
"$state",
[
"active",
"returned"
]
]
},
]
},
{
$and: [
{
$eq: [
"$state",
"booked"
]
},
{
$lte: [
"$startDate",
new Date()
]
},
{
$gte: [
"$startDate",
ISODate("2019-12-18T07:00:00.000Z")
]
}
]
}
]
},
true,
false
]
}
}
}
])
In the above, the following lines in the $cond statement does not work at all:
$eq: [
"$listing.0.inspectionStatus",
"none"
]
My question is - how do I make the above work? Note that there is always only one array item in the listing field after the lookup (never more than one array item in there). I've tried different variations like $listing.$0.$inspectionStatus - but nothing seems to work. I could go down the trajectory of researching group and filter - but I feel like this is overkill when I simply always want to access the first and only item in the listing array.
Please use $in keyword instead of $eq keyword in $cond keyword
db.demo1.aggregate([
{
$lookup: {
from: "demo2",
localField: "listingId",
foreignField: "_id",
as: "listing"
}
},
{
$match: {
$and: [
{
locationId: ObjectId("5c0f0c882fcf07fb08890c27")
},
{
$or: [
{
$and: [
{
state: "booked"
},
{
startDate: {
$lte: new Date()
}
},
{
startDate: {
$gte: ISODate("2019-12-18T07:00:00.000Z")
}
}
]
},
{
$and: [
{
listing: {
$elemMatch: {
inspectionStatus: "none"
}
}
},
{
endDate: {
$lte: new Date()
}
},
{
endDate: {
$gte: ISODate("2019-12-18T07:00:00.000Z")
}
},
{
state: {
$in: [
"active",
"returned"
]
}
}
]
},
{
$and: [
{
state: {
$ne: "cancelled"
}
},
{
$or: [
{
$and: [
{
startDate: {
$gte: ISODate("2019-12-20T07:00:00.993Z")
}
},
{
startDate: {
$lte: ISODate("2019-12-21T06:59:59.999Z")
}
}
]
},
{
$and: [
{
endDate: {
$gte: ISODate("2019-12-20T07:00:00.993Z")
}
},
{
endDate: {
$lte: ISODate("2019-12-21T06:59:59.999Z")
}
}
]
}
]
}
]
}
]
}
]
}
},
{
$addFields: {
isLate: {
$cond: [
{
$or: [
{
$and: [
{
$in: [
"none",
"$listing.inspectionStatus",
]
},
{
$lte: [
"$endDate",
new Date()
]
},
{
$gte: [
"$endDate",
ISODate("2019-12-18T07:00:00.000Z")
]
},
{
$in: [
"$state",
[
"active",
"returned"
]
]
},
]
},
{
$and: [
{
$eq: [
"$state",
"booked"
]
},
{
$lte: [
"$startDate",
new Date()
]
},
{
$gte: [
"$startDate",
ISODate("2019-12-18T07:00:00.000Z")
]
}
]
}
]
},
true,
false
]
}
}
}
])
I have documents in db in the following format:
{
"_id" : ObjectId("5d6fb50852020c4a182fc773"),
"startTimestamp" : "1567601927157"
}
What I want to achieve is, using the "startTimestamp" value, create the following new fields:
date (in the format "04-09-2019")
hour (like "18")
month (like "9")
time (like "18:28:47")
weekDay (like "Wednesday")
Can I get a query to do the above operation in all the documents and finally create respective documents in the following format:
{
"startTimestamp" : "1567601927157",
"date" : "04-09-2019",
"hour" : "18",
"month" : "9",
"time" : "18:28:47",
"weekDay" : "Wednesday",
}
Edit:
"startTimestamp" is not the only field present in the documents, it has other fields as well, like below:
{
"useCaseStatus" : "In Progress",
"feedbackRequested" : false,
"userFeedback" : null,
"startTimestamp" : "1567669352778"
}
By adding new fields to the above document, I dont want to delete the fields that are already present(because all the solutions I have got so far removes the other fields present in the documents). Also, adding one more expected document below (Please note that hour and month fields are in string format, not int):
{
"useCaseStatus" : "In Progress",
"feedbackRequested" : false,
"userFeedback" : null,
"startTimestamp" : "1567669352778",
"endTimestamp" : null,
"date" : "05-09-2019",
"hour" : "13",
"month" : "9",
"time" : "13:12:32",
"weekDay" : "Thursday"
}
You can use below aggregation
db.collection.aggregate([
{ "$replaceRoot": {
"newRoot": {
"$let": {
"vars": { "date": { "$toDate": { "$toLong": "$startTimestamp" } } },
"in": {
"$mergeObjects": [
{
"date": { "$dateToString": { "date": "$$date", "format": "%d-%m-%Y" } },
"month": { "$toString": { "$month": "$$date" } },
"hour": { "$toString": { "$hour": "$$date" } },
"time": { "$dateToString": { "date": "$$date", "format": "%H-%M-%S" } },
"weekDay": { "$dayOfWeek": "$$date" }
},
"$$ROOT"
]
}
}
}
}},
{ "$out": "collectionName" }
])
Output
{
"date": "04-09-2019",
"hour": 12,
"month": 9,
"startTimestamp": "1567601927157",
"time": "12-58-47",
"weekDay": 4
}
You need to start with $toLong and $toDate to parse your string. Then you can use $dateToParts and $dayOfWeek. To translate number into string you can use $switch
db.collection.aggregate([
{
$addFields: {
date: {
$toDate: {
$toLong: "$startTimestamp"
}
}
}
},
{
$addFields: {
dateParts: { $dateToParts: { date: "$date" } },
dayOfWeek: { $dayOfWeek: "$date" }
}
},
{
$project: {
startTimestamp: 1,
date: { $dateToString: { date: "$date", format: "%d-%m-%Y" } },
hour: "$dateParts.hour",
month: "$dateParts.month",
time: { $dateToString: { date: "$date", format: "%H:%M:%S" } },
weekDay: {
$switch: {
branches: [
{ case: { $eq: [ "$dayOfWeek", 1 ] }, then: "Sunday" },
{ case: { $eq: [ "$dayOfWeek", 2 ] }, then: "Monday" },
{ case: { $eq: [ "$dayOfWeek", 3 ] }, then: "Tuesday" },
{ case: { $eq: [ "$dayOfWeek", 4 ] }, then: "Wednesday" },
{ case: { $eq: [ "$dayOfWeek", 5 ] }, then: "Thursday" },
{ case: { $eq: [ "$dayOfWeek", 6 ] }, then: "Friday" }
],
default: "Saturday"
}
}
}
}
])
Mongo Playground
You need to implement aggregate pipeline and use date operators available but as you have millisecond saved in string first we have to convert it to int then date then perfrom date operators notice some of them will need timezone to give accurate result instead will just give utc results
db.collection.aggregate([
{
$addFields: {
longMillis: {
$toLong: "$startTimestamp"
}
}
},
{
$project: {
startTimestamp: 1,
"date": {
"$add": [
new Date(0),
"$longMillis"
]
}
}
},
{
$project: {
startTimestamp: 1,
month: {
$month: "$date"
},
day: {
$switch: {
branches: [
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
1
]
},
then: "Sunday"
},
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
2
]
},
then: "Monday"
},
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
3
]
},
then: "Tuesday"
},
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
4
]
},
then: "Wednesday"
},
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
5
]
},
then: "Thursday"
},
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
6
]
},
then: "Friday"
},
{
case: {
$eq: [
{
$dayOfMonth: "$date"
},
7
]
},
then: "Saturday"
},
],
default: 6
}
},
hour: {
$hour: {
"date": "$date",
"timezone": "+05:30"
}
},
date: {
$dateToString: {
format: "%d-%m-%Y",
date: "$date"
}
},
time: {
$dateToString: {
format: "%H:%M:%S",
date: "$date",
timezone: "+05:30"
}
},
}
}
])
Giving result:
[
{
"date": "04-09-2019",
"day": "Wednesday",
"hour": 18,
"month": 9,
"startTimestamp": "1567601927157",
"time": "18:28:47"
}
]
I have a collection called "project" which is having a field expected time and actual time both are in string format
{
"_id" : ObjectId("5ce7455d77af2d1143f84d49"),
"project_name" : "p1",
"expected" : "0:11:30",
"actual" : "7:30:00",
}
How can I compare two string format times using mongodb?
I want to find if actual time is more than expected
You can use $split with $toInt (MongoDB 4.0 or newer) to convert your string values to a number of seconds and then use $expr to compare both fields:
db.col.aggregate([
{
$addFields: {
expected: {
$let: {
vars: {
parts: {
$split: [ "$expected", ":" ]
}
},
in: {
$sum: [
{ $toInt: { $arrayElemAt: [ "$$parts", 2 ] } },
{ $multiply: [ 60, { $toInt: { $arrayElemAt: [ "$$parts", 1 ] } } ] },
{ $multiply: [ 3600, { $toInt: { $arrayElemAt: [ "$$parts", 0 ] } } ] }
]
}
}
},
actual: {
$let: {
vars: {
parts: {
$split: [ "$actual", ":" ]
}
},
in: {
$sum: [
{ $toInt: { $arrayElemAt: [ "$$parts", 2 ] } },
{ $multiply: [ 60, { $toInt: { $arrayElemAt: [ "$$parts", 1 ] } } ] },
{ $multiply: [ 3600, { $toInt: { $arrayElemAt: [ "$$parts", 0 ] } } ] }
]
}
}
}
}
},
{
$match: {
$expr: { $gt: [ "$expected", "$actual" ] }
}
}
])
You can convert time to any date you want using $dateFromString operator and then can easily use $lte $gte to perform simple match operations.
db.collection.find({
"$expr": {
"$gt": [
{ "$dateFromString": {
"dateString": {
"$concat": ["2018-09-19", "T", "$actual"]
}
}},
{ "$dateFromString": {
"dateString": {
"$concat": ["2018-09-19", "T", "$expected"]
}
}}
]
}
})