mongo-object-reader
This module allows you to create and parse ObjectID
s without a reference to the
mongodb or bson
modules.
Install
$ npm install mongo-object-reader
Usage
ES6; const createObjectID readObjectIDisValidObjectID = ;//Creates a new immutable `ObjectID` instance based on the current system time.const ObjectID = //a valid 24 character `ObjectID` hex string. //returns boolean// input - a valid 24 character `ObjectID` hex string.const isValid = //returns an object with data// input - a valid 24 character `ObjectID` hex string.const objectData = console //ObjectIDconsole // trueconsole /*{ ObjectID: '5e92d4be2ced3f58d92187f5', timeStamp: { hex: '5e92d4be', value: 1586681022, createDate: 1970-01-19T08:44:41.022Z }, random: { hex: '2ced3f58d9', value: 192958912729 }, incrementValue: { hex: '2187f5', value: 2197493 } }*/
License
MIT