-
-
Save mtrakal/a05ca0021bed224bad64f98baced412b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Record> getRecordsWithTransferId(final String transferId) { | |
com.couchbase.lite.Query query = CouchBaseModule.getDatabase().createAllDocumentsQuery(); | |
query.setAllDocsMode(com.couchbase.lite.Query.AllDocsMode.ALL_DOCS); | |
query.setPostFilter(new Predicate<QueryRow>() { | |
@Override | |
public boolean apply(QueryRow type) { | |
if (!type.getDocumentId().startsWith("Record_")) { | |
return false; | |
} | |
Map<String, Object> map = type.getDocument().getUserProperties(); | |
return map.containsKey(TRANSFER_ID) && map.get(TRANSFER_ID).equals(transferId); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment