|
|
@@ -60,11 +60,11 @@ module.exports = {
|
|
|
andOp.add(sub2);
|
|
|
andOp.add(sub3);
|
|
|
|
|
|
- assert.ok(andOp.matchesBSON({"a":5, "b":6}, null));
|
|
|
- assert.ok(!andOp.matchesBSON({"a":5}, null));
|
|
|
- assert.ok(!andOp.matchesBSON({"b":6}, null ));
|
|
|
- assert.ok(!andOp.matchesBSON({"a":1, "b":6}, null));
|
|
|
- assert.ok(!andOp.matchesBSON({"a":10, "b":6}, null));
|
|
|
+ assert.ok(andOp.matchesJSON({"a":5, "b":6}, null));
|
|
|
+ assert.ok(!andOp.matchesJSON({"a":5}, null));
|
|
|
+ assert.ok(!andOp.matchesJSON({"b":6}, null ));
|
|
|
+ assert.ok(!andOp.matchesJSON({"a":1, "b":6}, null));
|
|
|
+ assert.ok(!andOp.matchesJSON({"a":10, "b":6}, null));
|
|
|
},
|
|
|
"Should have an elemMatchKey": function(){
|
|
|
var baseOperand1 = {"a":1},
|
|
|
@@ -81,11 +81,11 @@ module.exports = {
|
|
|
andOp.add(sub2);
|
|
|
|
|
|
details.requestElemMatchKey();
|
|
|
- assert.ok(!andOp.matchesBSON({"a":[1]}, details));
|
|
|
+ assert.ok(!andOp.matchesJSON({"a":[1]}, details));
|
|
|
assert.ok(!details.hasElemMatchKey());
|
|
|
- assert.ok(!andOp.matchesBSON({"b":[2]}, details));
|
|
|
+ assert.ok(!andOp.matchesJSON({"b":[2]}, details));
|
|
|
assert.ok(!details.hasElemMatchKey());
|
|
|
- assert.ok(andOp.matchesBSON({"a":[1], "b":[1, 2]}, details));
|
|
|
+ assert.ok(andOp.matchesJSON({"a":[1], "b":[1, 2]}, details));
|
|
|
assert.ok(details.hasElemMatchKey());
|
|
|
// The elem match key for the second $and clause is recorded.
|
|
|
assert.strictEqual("1", details.elemMatchKey());
|