Answer the question
In order to leave comments, you need to log in
How to select Mongo documents internal property list?
Let's say we have a collection of users and their photo data:
{
name: "Вася",
photos: [
{name: "Я в Нигерии", date: 2012-02-14},
{name: "Я в Бутане", date: 2012-03-15},
]
},
{
name: "Петя",
photos: [
{name: "Я неудачник", date: 2012-02-29},
]
}
Answer the question
In order to leave comments, you need to log in
I suppose that without code on the client, this can be done either through Map / Reduce (and it seems to be blocking), or the Aggregation Framework , which has already been mentioned here, but will only be in 2.2.
I'd be pleasantly surprised if it could be easier.
I'm superficially familiar with mongo, but maybe you can write pictures to another collection with a link to objects from the first collection. Then you can just put the pictures in the form
{
date : "12-10-2012",
description : "Я в Гондурасе",
owner : "1234"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question