PouchDB – Adding Attachment You can attach a binary object to a document using the putAttachment() method in PouchDB. Syntax Following is the syntax of the putAttachment(). To this method, we have to pass the document id, attachment id, MIME type along with the attachment. This method also accepts an optional callback function. db.putAttachment( docId, […]
Author Archives: user
PouchDB – Replication One of the most important features of PouchDB is replication, i.e. you can make a copy of a database. You can replicate either a PouchDB instance stored locally or a CouchDB instance stored remotely. Syntax Following is the syntax of replicating a database in PouchDB. Here, a copy of the source database […]
PouchDB – Delete Batch You can delete an array of documents in PouchDB at once using the bulkDocs() method. To do so you need to create an array of documents that are to be deleted where, each document should contain _id and _rev. In addition to these you have to add another key-value pair _deleted: […]