[firestore][android] Couple of fixes
This commit is contained in:
parent
8ac16931a6
commit
f56435226d
|
@ -93,6 +93,8 @@ public class FirestoreSerialize {
|
|||
|
||||
documentChangeMap.putMap(KEY_DOC_CHANGE_DOCUMENT,
|
||||
snapshotToWritableMap(documentChange.getDocument()));
|
||||
documentChangeMap.putInt(KEY_DOC_CHANGE_NEW_INDEX, documentChange.getNewIndex());
|
||||
documentChangeMap.putInt(KEY_DOC_CHANGE_OLD_INDEX, documentChange.getOldIndex());
|
||||
|
||||
return documentChangeMap;
|
||||
}
|
||||
|
|
|
@ -55,14 +55,14 @@ public class RNFirebaseFirestoreCollectionReference {
|
|||
|
||||
private Query buildQuery() {
|
||||
Query query = RNFirebaseFirestore.getFirestoreForApp(appName).collection(path);
|
||||
query = applyFilters(query, filters);
|
||||
query = applyOrders(query, orders);
|
||||
query = applyOptions(query, options);
|
||||
query = applyFilters(query);
|
||||
query = applyOrders(query);
|
||||
query = applyOptions(query);
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
private Query applyFilters(Query query, ReadableArray filters) {
|
||||
private Query applyFilters(Query query) {
|
||||
List<Object> filtersList = Utils.recursivelyDeconstructReadableArray(filters);
|
||||
|
||||
for (Object f : filtersList) {
|
||||
|
@ -92,7 +92,7 @@ public class RNFirebaseFirestoreCollectionReference {
|
|||
return query;
|
||||
}
|
||||
|
||||
private Query applyOrders(Query query, ReadableArray orders) {
|
||||
private Query applyOrders(Query query) {
|
||||
List<Object> ordersList = Utils.recursivelyDeconstructReadableArray(orders);
|
||||
for (Object o : ordersList) {
|
||||
Map<String, Object> order = (Map) o;
|
||||
|
@ -104,7 +104,7 @@ public class RNFirebaseFirestoreCollectionReference {
|
|||
return query;
|
||||
}
|
||||
|
||||
private Query applyOptions(Query query, ReadableMap options) {
|
||||
private Query applyOptions(Query query) {
|
||||
if (options.hasKey("endAt")) {
|
||||
ReadableArray endAtArray = options.getArray("endAt");
|
||||
query = query.endAt(Utils.recursivelyDeconstructReadableArray(endAtArray));
|
||||
|
|
|
@ -30,6 +30,10 @@ public class RNFirebaseFirestoreDocumentReference {
|
|||
this.ref = RNFirebaseFirestore.getFirestoreForApp(appName).document(path);
|
||||
}
|
||||
|
||||
public void collections(Promise promise) {
|
||||
// Not supported on Android
|
||||
}
|
||||
|
||||
public void create(ReadableMap data, Promise promise) {
|
||||
// Not supported on Android out of the box
|
||||
}
|
||||
|
@ -109,8 +113,4 @@ public class RNFirebaseFirestoreDocumentReference {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void collections(Promise promise) {
|
||||
// Not supported on Android out of the box
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue