loopbackio / loopbackio/loopback-connector-mongodb
v.match is not a function
Open
Nobody has claimed this yet.
question
- Dominant language
- JavaScript
- Stars
- 186
- Forks
- 238
- Avg merge
- 2h 49m
- Merged PRs (30d)
- 1
Description
The function below is fixed and merged in the v5.x branch but wasn't released for loopback3. Is there a specific version which support loopback3 and have this fix.
function isObjectIDProperty(modelCtor, propDef, value, options) {
if (!propDef) return false;
if ((typeof value === 'string' && value.match(ObjectIdValueRegex)) ||
(Array.isArray(value) && value.every((v) => v.match(ObjectIdValueRegex)))) {
if (isStoredAsObjectID(propDef)) return true;
else return !isStrictObjectIDCoercionEnabled(modelCtor, options);
} else if (value instanceof mongodb.ObjectID) {
return true;
} else {
return false;
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the shown isObjectIDProperty function with the v5.x branch and reviewing the connector's release history for LoopBack 3 compatibility. Confirm whether the fix was included in a released version that supports LoopBack 3; if not, document that no such release is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100