coactive-node-api-recruitment.admin
v1.0.1
Published
Quite often you'll need to write tests with objects that need unique IDs, e.g.
Downloads
3
Readme
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": "[email protected]"
},
...
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