Accessing the Array Elements on the basis of index

11 views
Skip to first unread message

Sagar

unread,
Aug 3, 2016, 9:21:49 AM8/3/16
to mongodb-dev
Hello All,

I am using aggregation for finding the documents which contains multiple arrays in the document. I have used the unwind to match the condition with array element and also used the index in the same unwind statement so that I will get the index of the Array element matched.

Now from that index I want to project the elements from the other array elements which are present in the same document. Could it be possible to project the data on the basis of the index.

And one more question is could we use the two path in the Unwind statement.?

Thanks and Best Regards,
Sagar

Charlie Swanson

unread,
Aug 5, 2016, 9:56:50 AM8/5/16
to mongodb-dev
Hi Sagar,

This list is for developers *of* MongoDB - please ask your question on the MongoDB-user Google Group.

I'm not sure I totally understand the question, an example would help, but maybe $arrayElemAt is what you're looking for?

--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev...@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages