PouchDB Retrieve Attachment
PouchDB Retrieve Attachment
- getAttachment() - This method is used to retrieve an attachment from PouchDB. This method always returns blob or buffer objects
PouchDB Retrieve Attachment
Syntax:
Example
- Using getAttachment() method to retrieve an attachment att_1.txt from the document "002" from the database named "Last_Database".
Read Also
Save the file name as "read_attachment.js" within a folder name "PouchDB_Examples". Open the command prompt and execute the javascript file using node.
PouchDB Retrieve Attachment
Retrieve Attachment from a Remote Document
Example
PouchDB Retrieve Attachment
- Click on the "employees" database. You will see the documents within the database.
PouchDB Retrieve Attachment
- You can see a document having id "001". Click on the id and you will find the attachment.
PouchDB Retrieve Attachment
- You can see it by using Node.js command prompt:
Save the file name as "Read_Remote_attachment.js" within a folder name "PouchDB_Examples". Open the command prompt and execute the javascript file using node.
Output:
PouchDB Retrieve Attachment