summaryrefslogtreecommitdiff
path: root/jstests/core/SERVER-23626.js
blob: f4f014952691d215fd4ae7e00d5489723a787768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(function() {

    "use strict";
    var t = db.jstests_server23626;

    t.mycoll.drop();
    assert.writeOK(t.mycoll.insert({_id: 0, a: Date.prototype}));
    assert.eq(1, t.mycoll.find({a: {$type: 'date'}}).itcount());

    t.mycoll.drop();
    assert.writeOK(t.mycoll.insert({_id: 0, a: Function.prototype}));
    assert.eq(1, t.mycoll.find({a: {$type: 'javascript'}}).itcount());

    t.mycoll.drop();
    assert.writeOK(t.mycoll.insert({_id: 0, a: RegExp.prototype}));
    assert.eq(1, t.mycoll.find({a: {$type: 'regex'}}).itcount());

}());