Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 686 Bytes

File metadata and controls

28 lines (23 loc) · 686 Bytes

couchdb continuous changes

A library for fetching feeds from a CouchDB database using a continuous feed

Example

import 'dart:convert';
import 'package:couchdb_continuous_changes/couchdb_continuous_changes.dart';

Future<void> main() async {
  CouchDbFeed couchDbFeed = CouchDbFeed(
    scheme: "http",
    host: "localhost",
    port: 5984,
    username: "username",
    password: "password",
    database: "database"
  );

  final continuousFeed = await couchDbFeed.continuous();
  continuousFeed.listen((FeedResponse item) {
    print("feed sequence: ${item.seq}");
    print("feed doc id: ${item.id}");
    print("feed doc data: ${json.encode(item.doc)}");
  });
}