I have a question, lets say I have a collection called contact :
[
{"firstName": "Adam", "lastName":"Peter", "email":"adam@peter.com"},
{"firstName": "Adam", "lastName":"John", "email":"adam@john.com"},
{"firstName": "Adam", "lastName":"Petkovic", "email":"adam@petkovic.com"}
]
What I want is to search specifically, for example: I want to search "Adam peter"
then I want to have a result of the first one ONLY which has Adam and peter.
I use meteor + mongo + react
for my application.
Any suggestion / recommendation would be high appreciated.
Thanks for all the answers, but probably I need to ask more specific in order to get more appropriate answer.
Scenarios:
- I only have 1 text box to search all the fields.
So:
when I enter "Adam", I expect to have 3 results. but when I enter "Adam Peter" I expect to have 1 result only.
When I enter "peter.com" it should have 1 result
When I enter "John", it should have 1 result
When I enter "Adam Pet" it should have 2 results.