coactive-node-api-recruitment.admin

1.0.1 • Public • Published

Recruitment Admin API

Writing Tests

Quite often you'll need to write tests with objects that need unique IDs, e.g.

{
    "_id": { "$oid": "60096ef65f442f27745682b6" },
    "id": {
        "$binary": { "base64": "/vyWiAZlTwOx0JLUzhT0nQ==", "subType": "04" }
    },
    "userId": {
        "$binary": { "base64": "HXuCdG4jT2q1P90onEsxSQ==", "subType": "04" }
    },
    "jobOpportunityId": {
        "$binary": { "base64": "t8dKhc1ORUyYAp7Hr4rcvw==", "subType": "04" }
    },
    "user": {
        "email": "test@example.org"
    },
    ...

The _id is the Mongo ID.

The id is our UUIDv4 compatible id, stored in binary format.

Generate mongo IDs at https://observablehq.com/@hugodf/mongodb-objectid-generator

Generate Base64 UUIDv4s at https://toolslick.com/text/encoder/base64 (Click 'Generate', then use blue button "With output: Base64 encoder" to get the Base64 equivalent)

Convert betweeen uuid formats (unfortunately with the exception of Mongo IDs) at https://toolslick.com/conversion/data/guid

Readme

Keywords

none

Package Sidebar

Install

npm i coactive-node-api-recruitment.admin

Weekly Downloads

1

Version

1.0.1

License

UNLICENSED

Unpacked Size

234 kB

Total Files

72

Last publish

Collaborators

  • switch-kris