[android][database] Fix startAt and endAt

This commit is contained in:
Chris Bianca 2017-05-02 13:56:50 +01:00
parent 9adeffef18
commit 7c9b094f54
1 changed files with 12 additions and 12 deletions

View File

@ -249,46 +249,46 @@ public class RNFirebaseDatabaseReference {
if ("number".equals(valueType)) { if ("number".equals(valueType)) {
double value = (Double) modifier.get("value"); double value = (Double) modifier.get("value");
if (key == null) { if (key == null) {
query = query.equalTo(value); query = query.endAt(value);
} else { } else {
query = query.equalTo(value, key); query = query.endAt(value, key);
} }
} else if ("boolean".equals(valueType)) { } else if ("boolean".equals(valueType)) {
boolean value = (Boolean) modifier.get("value"); boolean value = (Boolean) modifier.get("value");
if (key == null) { if (key == null) {
query = query.equalTo(value); query = query.endAt(value);
} else { } else {
query = query.equalTo(value, key); query = query.endAt(value, key);
} }
} else if ("string".equals(valueType)) { } else if ("string".equals(valueType)) {
String value = (String) modifier.get("value"); String value = (String) modifier.get("value");
if (key == null) { if (key == null) {
query = query.equalTo(value); query = query.endAt(value);
} else { } else {
query = query.equalTo(value, key); query = query.endAt(value, key);
} }
} }
} else if ("startAt".equals(name)) { } else if ("startAt".equals(name)) {
if ("number".equals(valueType)) { if ("number".equals(valueType)) {
double value = (Double) modifier.get("value"); double value = (Double) modifier.get("value");
if (key == null) { if (key == null) {
query = query.equalTo(value); query = query.startAt(value);
} else { } else {
query = query.equalTo(value, key); query = query.startAt(value, key);
} }
} else if ("boolean".equals(valueType)) { } else if ("boolean".equals(valueType)) {
boolean value = (Boolean) modifier.get("value"); boolean value = (Boolean) modifier.get("value");
if (key == null) { if (key == null) {
query = query.equalTo(value); query = query.startAt(value);
} else { } else {
query = query.equalTo(value, key); query = query.startAt(value, key);
} }
} else if ("string".equals(valueType)) { } else if ("string".equals(valueType)) {
String value = (String) modifier.get("value"); String value = (String) modifier.get("value");
if (key == null) { if (key == null) {
query = query.equalTo(value); query = query.startAt(value);
} else { } else {
query = query.equalTo(value, key); query = query.startAt(value, key);
} }
} }
} }