Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
generate and validate mongodb objectId strings without dependencies
one of the best parts about using objectIds in mongodb is being able to generate them at object creation time, rather than at database insert time. This module is super convenient for code when you don't want the full mongodb driver as a dependency, for example, for use with browserify.
New in 2.x, this module returns objects with the _bsontype
property set properly to be treated as BSON ObjectIDs, eg, for use in the native driver.
$ npm install objectid
var objectid = require('objectid')
var id = objectid()
objectid.isValid(id)
// => true
objectid.isValid('4frsdef43wzx')
// => false
objectid.isValid
returns true for mongodb
native driver ObjectID
objects, or any other representations with a .toString
method which returns the hex string encoding of a valid objectid.
Calling objectid
with an existing objectid - whether a string, an object created by this module, an objectid created by another driver (such as the result of a query) - will cast the value to an instanceof this module. It will throw if the argument is not a valid ObjectId.
From package root:
$ npm install
$ npm test
jden jason@denizac.org @leJDen
MIT. (c) 2013 Agile Diagnosis hello@agilediagnosis.com See LICENSE.md
FAQs
mongodb objectid utilities
The npm package objectid receives a total of 3,706 weekly downloads. As such, objectid popularity was classified as popular.
We found that objectid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.