Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for some filters for Fetching #13

Open
natanraj opened this issue Jun 23, 2015 · 11 comments
Open

Request for some filters for Fetching #13

natanraj opened this issue Jun 23, 2015 · 11 comments

Comments

@natanraj
Copy link

Hi
Can we add one small flexibility of passing some few parameters further to filter the Contacts. (Something like DisplayName having some pattern or Ph Numbers have some ISD code etc)

@dbaq
Copy link
Owner

dbaq commented Jun 23, 2015

as usual, I am ok with new features if it does not impact the performances on android. feel free to open a PR.

@natanraj
Copy link
Author

dbaq, I am sorry about my request description. I am requesting this feature on this plugin. I am not a developer to make these changes on my own on this source code.

@dbaq
Copy link
Owner

dbaq commented Jun 30, 2015

Which filter do you need exactly? what is the use case?

@natanraj
Copy link
Author

natanraj commented Jul 1, 2015

Use case : Currently it fetches all the Contacts with mobile numbers present. If i need to get contacts only having some phonenumbers with isd code (say +1 for US, +44 for UK) or having DisplayName starting with 'natan'.. etc. In short a filter applied on numbers and displayName fields at the SQL Fetch itself, than processed at JS layer.

Thanks

@dbaq
Copy link
Owner

dbaq commented Jul 19, 2015

It makes sense, after looking at the code, it should be doable. I was thinking about something like:

navigator.contactsPhoneNumbers.list(function(contacts) {}, function(error) {}, {
    filters: [{
        field: 'displayName',
        type: 'startsWith', //endsWith, contains
        values: ['a', 'b'] // startsWith a OR b
    }, {
        field: 'lastName',
        type: 'contains', //endsWith, startsWith
        values: ['z']
    }, {
        field: 'number',
        type: 'startsWith', //endsWith, contains
        values: ['415']
    }]
});

I have a doubt about the case sensitivity though. What do you think @natanraj?

@natanraj
Copy link
Author

Looks good. It has to be case insensitive like Cordova plugin.
On 20-Jul-2015 12:11 AM, "Didier Baquier" [email protected] wrote:

It makes sense, after looking at the code, it should be doable. I was
thinking about something like:

navigator.contactsPhoneNumbers.list(function(contacts) {}, function(error) {}, {
filters: [{
field: 'displayName',
type: 'startsWith', //endsWith, contains
values: ['a', 'b'] // startsWith a OR b
}, {
field: 'lastName',
type: 'contains', //endsWith, startsWith
values: ['z']
}, {
field: 'number',
type: 'startsWith', //endsWith, contains
values: ['415']
}]
});```

I have a doubt about the case sensitivity though. What do you think @natanraj?


Reply to this email directly or view it on GitHub
#13 (comment)
.

@ronycohen
Copy link

Hello @dbaq,

Do you think it's possible to add also the photos values ?

@dbaq
Copy link
Owner

dbaq commented Sep 27, 2015

there is another issue for the photos. see #11.

@ronycohen
Copy link

ok thank you.

@kodeine
Copy link
Contributor

kodeine commented May 25, 2017

is this feature implemented?

@dbaq
Copy link
Owner

dbaq commented May 25, 2017

@kodeine not yet, but any contribution is welcomed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants