Meteor-Community-Packages / Meteor-Community-Packages/meteor-autocomplete
Issue with selector with regex in return
Nobody has claimed this yet.
- Dominant language
- CoffeeScript
- Stars
- 350
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
I have seen a few examples like below:
```
selector: function(match) {
regex = new RegExp(match, 'i')
return {'profile.firstName': regex}
}
```
I am actually trying the code above. If I put a string in place of `regex`, it is passed and works correctly, but when I use the `regex` variable, the output sent to query looks like this `'profile.firstName': {} } { limit: 10, sort: { _id: 1 } }`. Notice the `regex` portion is missing.
Anyway, I am not sure why this doesn't work yet. Any thoughts?
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
No file or test is named; begin at the selector callback and the query-serialization entry point described in the report. Reproduce the difference between returning a string and a RegExp, then determine whether regex selectors are supported and verify that the resulting query is preserved or the limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100