EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

Is it possible to make more complex Query #477

Open dimitarmar opened 6 years ago

dimitarmar commented 6 years ago

Hello,

I am trying to implement basic search functionality. Is it possible to insert more than one condition for check. Also if I want to check for substring in some filed. In this example below inserted only one condition , but if needed more than one ? firebase.query( onQueryEventSearch, "/contacts/" + Model.getInstance().uid + "/" , { singleEvent: true,
orderBy: { type: firebase.QueryOrderByType.CHILD, value: 'user_uid' // mandatory when type is 'child' },
ranges: [ { type: firebase.QueryRangeType.EQUAL_TO, value: Model.getInstance().uid } ]
} );

Dashue commented 6 years ago

Ranges is an array hence it should be possible to to pass it multiple query range types?

abhayastudios commented 6 years ago

From what I understand, with the current firebase DB it is not really possible (see this discussion). However, Google released a beta version of the new Firestore which promises to allow compound queries and according to #507 this project should support it soon.