-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Minor Change
-
ALL
-
(copied to CRM)
This would effectively just output the existing field.
> db.reg.find() { "_id" : 1, "text" : "foo" } { "_id" : 2, "text" : "bar" } { "_id" : 3, "text" : "Bar" } { "_id" : 4, "text" : [ "bar", "foo" ] } >db.reg.aggregate({$match:{text:/ba/i}}, {$unwind:"$text"}) ... "errmsg" : "exception: $unwind: value at end of field path must be an array", "code" : 15978, "ok" : 0
This will be important for collections where some document fields may be arrays, but some may not.
- is duplicated by
-
SERVER-11718 Allow aggregation framework to optionally pass through non-arrays through $unwind
- Closed
- is related to
-
SERVER-12685 Expand $unwind behavior to include empty documents optionally
- Closed