Demo entry 6357157

test

   

Submitted by anonymous on Apr 21, 2017 at 09:24
Language: Java. Code size: 523 Bytes.

bucket
    .async()
    .get("walter")
    .flatMap(new Func1<JsonDocument, Observable<JsonDocument>>() {
        @Override
        public Observable<JsonDocument> call(final JsonDocument loaded) {
            loaded.content().put("age", 52);
            return bucket.async().replace(loaded);
        }
    })
    .subscribe(new Action1<JsonDocument>() {
        @Override
        public void call(final JsonDocument updated) {
            System.out.println("Updated: " + updated.id());
        }
    });

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).