summaryrefslogtreecommitdiff
path: root/jstests/aggregation/bugs/server6194.js
blob: c0c72decd82a1fb01cf4c5e58975090f759de212 (plain)
1
2
3
4
5
6
7
8
9
// make sure $concat doesn't optimize constants to the end
c = db.c;
c.drop();

c.save( { x:'3' } );

project = { $project:{ a:{ $concat:[ '1', { $concat:[ 'foo', '$x', 'bar' ] }, '2' ] } } };

assert.eq( '1foo3bar2', c.aggregate( project ).toArray()[ 0 ].a );