Hi,
I want to create view map every time for search different different key based on user input .
How i do that ?
Like , user enter a group code ,then i need to search into db , i need to create a view based on
user input.
groupView = mDatabase.getView("list/groups");
groupView.setMap(new Mapper() {
@Override
public void map(Map<String, Object> document, Emitter emitter) {
String type = (String) document.get("type");
if ("group".equals(type) && ((int) document.get("code"))== Integer.parseInt(code) ) {
emitter.emit(document.get("created_at"), null);
System.out.println("Got row"+code);
}
}
}, "1.0");
groupLiveQuery = groupView.createQuery().toLiveQuery();
But it is called only first time . Please help me