xmartlabs / rxsimplenosql Goto Github PK
View Code? Open in Web Editor NEWReactive extensions for SimpleNoSQL
License: Apache License 2.0
Reactive extensions for SimpleNoSQL
License: Apache License 2.0
Trying to delete multiple items from a bucket as described like this
bucket.newQuery()
.filter(sampleBean -> sampleBean.getName().startsWith("S"))
.delete()
.subscribe();
will and cannot work, as the SimpleNoSQL documentation for the QueryBuilder#filter method already states that it will only be used when retrieving items from a bucket.
Also if you look at the DataDispatcher class in the SimpleNoSQL project, you will see that in fact, it really just deletes either a single item or a whole bucket.
This is my workaround (deltedItems is a list of items I want to delete, obviously):
Completable completable = Completable.concat(
Observable.from(deletedItems)
.map(item -> localBucket
.newQuery()
.entityId(item.getId())
.delete()));
return completable.andThen(Observable.just(true));
Right now, the filter is not applied to an Observable
. Maybe a better approach is that entities are directly got as Observable
s, and then a filter can be applied. So this should return an Observable
instead: https://github.com/Jearil/SimpleNoSQL/blob/master/SimpleNoSQL/src/main/java/com/colintmiller/simplenosql/threading/DataDispatcher.java#L140
Hi! Thank you for nice lib, but I can't build project because every time I get error "Cannot access xxx method in ""com.xmartlabs.rxsimplenosql.Bucket.BucketQueryBuilder".
Example:
`class SampleBean implements Entity {
private String name;
private String id;
private Map<String, Integer> mapping;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Map<String, Integer> getMapping() {
return mapping;
}
public void setMapping(Map<String, Integer> mapping) {
this.mapping = mapping;
}
class sss{
Bucket<SampleBean> bucket;
public sss(Context context){
Bucket<SampleBean> bucket = new Bucket<>(context, SampleBean.class, "bucketId");
}
public void single(){
SampleBean entity = new SampleBean();
entity.setId("1");
entity.setName("Colin");
Map<String, Integer> birthday = new HashMap<String, Integer>();
birthday.put("day", 17);
birthday.put("month", 2);
birthday.put("year", 1982);
entity.setMapping(birthday);
bucket.newQuery()
.save(entity)
.subscribe();
}
}
}`
Have you any ideas what is the problem?
Something like the RxJava adapter for Retrofit: https://github.com/square/retrofit/blob/master/retrofit-adapters/rxjava/src/main/java/retrofit2/adapter/rxjava/RxJavaCallAdapterFactory.java#L139
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.