浏览代码

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 年之前
父节点
当前提交
2794c4c2f1
共有 1 个文件被更改,包括 10 次插入0 次删除
  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(){