

tAuthenticator(new BasicAuthenticator("sync-gateway", "password")) ReplicatorConfiguration replConfig = new ReplicatorConfiguration(database, targetEndpoint) Create replicators to push and pull changes to and from the cloud.Įndpoint targetEndpoint = new URLEndpoint(new URI("ws://localhost:4984/getting-started-db")) Log.i(TAG, "Number of rows :: " + result.allResults().size()) where(Expression.property("type").equalTo(Expression.string("SDK"))) Create a query to fetch documents of type SDK. Log.i(TAG, "Learning " + document.getString("language"))

Log.i(TAG, "Document ID :: " + document.getId()) Log the document ID (generated by the database) and properties tString("language", "Java") ĭocument document = database.getDocument(mutableDoc.getId()) MutableDoc = database.getDocument(mutableDoc.getId()).toMutable() MutableDocument mutableDoc = new MutableDocument() Get the database (and create it if it doesn’t exist).ĭatabaseConfiguration config = new DatabaseConfiguration() ĭatabase database = new Database("getting-started", config)
