Browse Source

refs #2424 added a failing test case for something that should work. if a Date is added to a $groups _id, it gets converted to a string

Phil Murray 12 years ago
parent
commit
2794c4c2f1
1 changed files with 10 additions and 0 deletions
  1. 10 0
      test/lib/pipeline/documentSources/GroupDocumentSource.js

+ 10 - 0
test/lib/pipeline/documentSources/GroupDocumentSource.js

@@ -183,6 +183,16 @@ module.exports = {
 					expected:{_id:5}
 				});
 			},
+			
+			// $group _id is a field path expression. g
+			"should compute _id a field path expression if expression evaluates to a Date": function advanceDateTest(){
+				var d = new Date();
+				assertExpectedResult({
+					docs:[{a:d}],
+					spec:{_id:"$a"},
+					expected:{_id:d}
+				});
+			},
 
 			// Aggregate the value of an object expression. g
 			"should aggregate the value of an object expression": function advanceTest(){