I have a scenario where peoples names like John J. Doe
and John J Doe
exist in two seperate databases
Using values from the first database I need to query my second database for an either or scenario and still return a match
[
{ _id: ..., name: 'John J Doe' },
{ _id: ..., name: 'John J. Doe' },
{ _id: ..., name: 'John J Doe' }
]
What can I do to query and get all results?
currently I am doing this:
const name = 'John J Doe'
records = db.getCollection('job_status_containers').find({ name: /^${name}/i })
an $or
query is not an option, this is going to be coming in from an API request and it just needs to be able to find it without much fluff
GET /some_endpoint?name=${encodeURIComponent(name)}