mirror of
https://github.com/hanzoai/docdb.git
synced 2026-10-30 18:39:39 +00:00
29 lines
527 B
JavaScript
29 lines
527 B
JavaScript
// Please do not merge changes in this file.
|
|
|
|
(function () {
|
|
"use strict";
|
|
|
|
// Update the following example with your test.
|
|
|
|
const coll = db.test;
|
|
|
|
coll.drop();
|
|
|
|
const init = [
|
|
{ _id: "double", v: 42.13 },
|
|
{ _id: "double-whole", v: 42.0 },
|
|
{ _id: "double-zero", v: 0.0 },
|
|
];
|
|
|
|
coll.insertMany(init);
|
|
|
|
const query = { v: { $gt: 42.0 } };
|
|
|
|
const expected = [{ _id: "double", v: 42.13 }];
|
|
|
|
const actual = coll.find(query).toArray();
|
|
assert.eq(expected, actual);
|
|
|
|
print("test.js passed!");
|
|
})();
|