Skip to content

Commit d5f7846

Browse files
committed
fix some more tests
1 parent 984874b commit d5f7846

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3524Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void SelectMany_should_translate_correctly()
6060
Meta : '$$meta',
6161
Property : {
6262
$arrayElemAt : [
63-
{ $filter : { input : '$Properties', as : 'p', cond : { $eq : ['$$p._id', '$$meta.PropertyId'] } } },
63+
{ $filter : { input : '$Properties', as : 'p', cond : { $eq : ['$$p._id', '$$meta.PropertyId'] }, limit : 1 } },
6464
0
6565
]
6666
}

tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp4048Tests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void List_get_Item_of_scalar_should_work()
118118
var expectedStages = new[]
119119
{
120120
"{ $group : { _id : '$_id', _elements : { $push: '$X' } } }",
121-
"{ $project : { _id : '$_id' Result : { $arrayElemAt : ['$_elements', 0] } } }",
121+
"{ $project : { _id : '$_id', Result : { $arrayElemAt : ['$_elements', 0] } } }",
122122
"{ $sort : { _id : 1 } }"
123123
};
124124
AssertStages(stages, expectedStages);
@@ -1043,7 +1043,7 @@ public void IGrouping_First_with_predicate_of_root_should_work()
10431043
var expectedStages = new[]
10441044
{
10451045
"{ $group : { _id : '$_id', _elements : { $push : '$$ROOT' } } }",
1046-
"{ $project : { _id : '$_id', Result : { $arrayElemAt : [{ $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e.X', 1] } } }, 0] } } }",
1046+
"{ $project : { _id : '$_id', Result : { $arrayElemAt : [{ $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e.X', 1] }, limit : 1 } }, 0] } } }",
10471047
"{ $sort : { _id : 1 } }"
10481048
};
10491049
AssertStages(stages, expectedStages);
@@ -1068,7 +1068,7 @@ public void IGrouping_First_with_predicate_of_scalar_should_work()
10681068
var expectedStages = new[]
10691069
{
10701070
"{ $group : { _id : '$_id', _elements : { $push : '$X' } } }",
1071-
"{ $project : { _id : '$_id', Result : { $arrayElemAt : [{ $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e', 1] } } }, 0] } } }",
1071+
"{ $project : { _id : '$_id', Result : { $arrayElemAt : [{ $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e', 1] }, limit : 1 } }, 0] } } }",
10721072
"{ $sort : { _id : 1 } }"
10731073
};
10741074
AssertStages(stages, expectedStages);
@@ -1143,7 +1143,7 @@ public void IGrouping_FirstOrDefault_with_predicate_of_root_should_work()
11431143
var expectedStages = new[]
11441144
{
11451145
"{ $group : { _id : '$_id', _elements : { $push : '$$ROOT' } } }",
1146-
"{ $project : { _id : '$_id', Result : { $let : { vars : { values : { $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e.X', 1] } } } }, in : { $cond : { if : { $eq : [{ $size : '$$values' }, 0] }, then : null, else : { $arrayElemAt : ['$$values', 0] } } } } } } }",
1146+
"{ $project : { _id : '$_id', Result : { $let : { vars : { values : { $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e.X', 1] }, limit : 1 } } }, in : { $cond : { if : { $eq : [{ $size : '$$values' }, 0] }, then : null, else : { $arrayElemAt : ['$$values', 0] } } } } } } }",
11471147
"{ $sort : { _id : 1 } }"
11481148
};
11491149
AssertStages(stages, expectedStages);
@@ -1169,7 +1169,7 @@ public void IGrouping_FirstOrDefault_with_predicate_of_scalar_should_work()
11691169
var expectedStages = new[]
11701170
{
11711171
"{ $group : { _id : '$_id', _elements : { $push : '$X' } } }",
1172-
"{ $project : { _id : '$_id', Result : { $let : { vars : { values : { $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e', 1] } } } }, in : { $cond : { if : { $eq : [{ $size : '$$values' }, 0] }, then : 0, else : { $arrayElemAt : ['$$values', 0] } } } } } } }",
1172+
"{ $project : { _id : '$_id', Result : { $let : { vars : { values : { $filter : { input : '$_elements', as : 'e', cond : { $ne : ['$$e', 1] }, limit : 1 } } }, in : { $cond : { if : { $eq : [{ $size : '$$values' }, 0] }, then : 0, else : { $arrayElemAt : ['$$values', 0] } } } } } } }",
11731173
"{ $sort : { _id : 1 } }"
11741174
};
11751175
AssertStages(stages, expectedStages);

0 commit comments

Comments
 (0)