Closed Tonnie-Dev closed 1 year ago
@Fanadezz , I'm happy you found this library useful for you.
If you're using kotlin, then it's very easy to convert this list into your model type class.
val itemList: MutableList<T> = mutableListOf()
//T is type of class or java object in which you want to convert data
geoQuery.get()
.addOnCompleteListener { firebaseFirestoreException, addedOrModifiedDataList, removedList ->
...
addedOrModifiedDataList.forEach { item ->
val objectT = item.toObject(T::class.java)
val idOfObjectInFirestore - item.id
//you can add this objectT in itemList or can use as your requirement
}
...
}
@chintan369 Thanks lots for this library. I managed to get addedOrModifiedDataList, which fell within distance and given query. However, I am not able to read the object and use it.
This is what I am getting on the log.
[DocumentSnapshot{key=UserPujLocation/Punjabi, metadata=SnapshotMetadata{hasPendingWrites=false, isFromCache=true}, doc=Document{key=UserPujLocation/Punjabi, data=com.google.firebase.firestore.model.ObjectValue@90f60cb1, version=SnapshotVersion(seconds=1599923161, nanos=519260000), documentState=COMMITTED_MUTATIONS}}]
How do I make use of this object?