Answer the question
In order to leave comments, you need to log in
How to select from document field which is an array in MongoDB?
There is a collection with objects of this kind:
{
"_id": ObjectId("57dea6ec32d8c016fa9377d0"),
"url": "http://site1.ru",
"checks": [{
"date": ISODate("2016-09-18T10:20:30Z"),
"result": 5
}, {
"date": ISODate("2016-09-15T20:05:05Z"),
"result": 1
}, {
"date": ISODate("2016-09-10T17:30:10Z"),
"result": 7
}]
}
{
"_id": ObjectId("57dea70032d8c016fa9377d1"),
"url": "http://site2.ru",
"checks": [{
"date": ISODate("2016-09-14T12:13:14Z"),
"result": 3
}, {
"date": ISODate("2016-09-05T15:16:17Z"),
"result": 0
}, {
"date": ISODate("2016-09-03T18:19:20Z"),
"result": 2
}]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question