How to use the MaxKey function from bson

Find comprehensive JavaScript bson.MaxKey code examples handpicked from public code repositorys.

1
2
3
4
5
6
7
8
9
10
11


const expect = require('chai').expect;
const bson = require('bson');
const ObjectId = bson.ObjectId;
const MinKey = bson.MinKey;
const MaxKey = bson.MaxKey;
const Binary = bson.Binary;
const BSONRegExp = bson.BSONRegExp;
const Code = bson.Code;
const Timestamp = bson.Timestamp;
fork icon121
star icon761
watch icon0

+ 7 other calls in file

54
55
56
57
58
59
60
61
62
63
/** @type {import('bson').Long} */
module.exports.Long = BSONJS.Long;
/** @type {import('bson').Map} */
module.exports.Map = BSONJS.Map;
/** @type {import('bson').MaxKey} */
module.exports.MaxKey = BSONJS.MaxKey;
/** @type {import('bson').MinKey} */
module.exports.MinKey = BSONJS.MinKey;
/** @type {import('bson').ObjectId} */
module.exports.ObjectId = BSONJS.ObjectId;
fork icon0
star icon0
watch icon0

+ 12 other calls in file

156
157
158
159
160
161
162
163
164
165

  expect(test2).to.eql(test);
});

it('should convert MaxKey to string', function () {
  const test = { key: new bson.MaxKey() };
  const result = libBson.toString(test);

  const test2 = libBson.toBSON(result);
  expect(test2.key._bsontype).to.eql('MaxKey');
fork icon0
star icon0
watch icon0