summaryrefslogtreecommitdiff
path: root/jstests/aggregation
diff options
context:
space:
mode:
authordannenberg <dannenberg.matt@gmail.com>2011-06-28 11:23:22 -0400
committerdannenberg <dannenberg.matt@gmail.com>2011-06-28 11:23:22 -0400
commit98c38bc73568f1d5143b6f9dae4be3c1a5bed03c (patch)
tree0629f96864d9532e84d083cc4f7720d3025eddec /jstests/aggregation
parentb9afca9db946f00aa7e1e0a213c223b7c5c1f38b (diff)
downloadmongo-98c38bc73568f1d5143b6f9dae4be3c1a5bed03c.tar.gz
strcmp added
Diffstat (limited to 'jstests/aggregation')
-rw-r--r--jstests/aggregation/testall.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/jstests/aggregation/testall.js b/jstests/aggregation/testall.js
index 1360ed58389..75e66422a56 100644
--- a/jstests/aggregation/testall.js
+++ b/jstests/aggregation/testall.js
@@ -757,6 +757,47 @@ var p17result = [
assert(arrayEq(p17.result, p17result), 'p17 failed');
+// strcmp test
+var p18 = db.runCommand(
+{aggregate : "article", pipeline : [
+ { $project : {
+ tags : 1,
+ thisisalametest : {$strcmp: ["foo","bar"]},
+ thisisalamepass : {$strcmp: ["foo","foo"]}
+ }}
+]});
+
+var p18result = [
+ {
+ "_id" : ObjectId("4e09ee2d75f2a257194c996e"),
+ "tags" : [
+ "fun",
+ "good"
+ ],
+ "thisisalametest" : false,
+ "thisisalamepass" : true
+ },
+ {
+ "_id" : ObjectId("4e09ee2d75f2a257194c996f"),
+ "tags" : [
+ "fun",
+ "nasty"
+ ],
+ "thisisalametest" : false,
+ "thisisalamepass" : true
+ },
+ {
+ "_id" : ObjectId("4e09ee2d75f2a257194c9970"),
+ "tags" : [
+ "nasty",
+ "filthy"
+ ],
+ "thisisalametest" : false,
+ "thisisalamepass" : true
+ }
+];
+
+assert(arrayEq(p18.result, p18result), 'p18 failed');