2016-02-04 12:29:01 -05:00
|
|
|
t = db.array1;
|
|
|
|
|
t.drop();
|
2009-07-16 12:06:36 -04:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
x = {
|
|
|
|
|
a: [1, 2]
|
|
|
|
|
};
|
2009-07-16 12:06:36 -04:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
t.save({a: [[1, 2]]});
|
|
|
|
|
assert.eq(1, t.find(x).count(), "A");
|
2009-07-16 12:06:36 -04:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
t.save(x);
|
2009-07-16 12:06:36 -04:00
|
|
|
delete x._id;
|
2016-03-09 12:17:50 -05:00
|
|
|
assert.eq(2, t.find(x).count(), "B");
|
2009-07-16 12:06:36 -04:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
t.ensureIndex({a: 1});
|
|
|
|
|
assert.eq(2, t.find(x).count(), "C"); // TODO SERVER-146
|