How to use the bson-ext.ObjectID function in bson-ext

To help you get started, we’ve selected a few bson-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thomas4019 / pgmongo / test / util.js View on Github external
it('array of ids', function () {
    assert.deepEqual(getArrayPaths({ arr: [BSON.ObjectID('5b1e1a6fa00fd75c4e6c4c30'), BSON.ObjectID('5b1e1a6fa00fd75c4e6c4c32')] }), ['arr'])
  })
  it('object with mixed', function () {
github thomas4019 / pgmongo / test / util.js View on Github external
it('object with mixed', function () {
    assert.deepEqual(describeTypes({ a: '123', id2: BSON.ObjectID('5b1e1a6fa00fd75c4e6c4c30') }), { id2: 'ObjectID'})
  })
})
github thomas4019 / pgmongo / test / util.js View on Github external
it('array of ids', function () {
    assert.deepEqual(describeTypes({ arr: [BSON.ObjectID('5b1e1a6fa00fd75c4e6c4c30'), BSON.ObjectID('5b1e1a6fa00fd75c4e6c4c32')] }), { arr: ['ObjectID'] })
  })
  it('object with mixed', function () {
github thomas4019 / pgmongo / index.js View on Github external
const convertToBSON = function(doc) {
  if (doc && doc._id && doc._id.length === 24) {
    doc._id = BSON.ObjectID(doc._id)
  }
  return doc
}

bson-ext

The C++ bson parser for the node.js mongodb driver.

Apache-2.0
Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis

Popular bson-ext functions