Articles → MONGODB → $Unwind Aggregation Operator In Mongodb$Unwind Aggregation Operator In MongodbIn this article, we will discuss the $unwind aggregation operator in MongoDB.Purpose The $unwind aggregation operator is used to deconstruct an array field from an input document and outputs the document for each element in an array.Syntax { $unwind: "<field>" }Example Consider the following collections: -To unwind the array, write the following query: -db.authors.aggregate([ { $unwind: "$authors" } ])Output Posted By - Karan Gupta Posted On - Thursday, June 6, 2024 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
{ $unwind: "<field>" }
db.authors.aggregate([ { $unwind: "$authors" } ])
Query/Feedback