3

I can't figure out how to use the LIKE operator on Firestore with React-redux-firebase.

I would like something similar to this:

Select * from countries where name LIKE %xico% //RESULT = Mexico

I tried the following:

import { firestoreConnect } from 'react-redux-firebase'

var name = 'xico'

export default compose(
  connect(mapStateToProps),firestoreConnect([{ collection : 'countries', orderBy :'name',startAt:name,endAt:name+'\uf8ff'}]) 
)(Dashboard);

But, it does not work.

VahidNaderi
  • 2,448
  • 1
  • 23
  • 35
user14232549
  • 405
  • 4
  • 17
  • 1
    Does this answer your question? https://stackoverflow.com/q/22506531/2873538 – Ajeet Shah Mar 14 '21 at 07:03
  • 1
    Does this answer your question? [How to perform sql "LIKE" operation on firebase?](https://stackoverflow.com/questions/22506531/how-to-perform-sql-like-operation-on-firebase) – Brettski Mar 14 '21 at 07:11
  • 1
    I am looking for a way to perform on the "react-redux-firebase"module. – user14232549 Mar 14 '21 at 12:22
  • There are no substring searches in Firebase (any platform) so you can't directly do that. Read the info provided in the above links for a solution. As an alternative, you can check out [ElasticStore](https://github.com/acupofjose/elasticstore). – Jay Mar 14 '21 at 13:52

0 Answers0