CenterForDigitalHumanities / TPEN-services

Services required by TPEN interfaces in order to interact with data
1 stars 0 forks source link

`isValid(id)` for db controller #101

Open cubap opened 4 months ago

cubap commented 4 months ago

Specific to the various drivers, we should have access to a method to check for a valid id for lookup, as with mongoose.Types.ObjectId.isValid('5c0a794449d898a0f4911426') in mongoose/MongoDB or maybe something like isValidId = (id) => ObjectId(id).toString() === id with better try-catch handling for MongoDB. The task here is to implement in the driver and then abstract for the methods.

cubap commented 4 months ago

image

cubap commented 4 months ago

@thehabes It works on my machine. All green on the PR for the hotfix. I'll wait to put anything else in until this is pushed through