PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.
PouchDB MCQs: This section contains multiple-choice questions and answers on the various topics of PouchDB. Practice these MCQs to test and enhance your skills on PouchDB.
List of PouchDB MCQs
1. PouchDB is written in ____?
Answer: B) JavaScript
Explanation:
PouchDB is written in JavaScript.
2. Which of the following format does PouchDB uses to store the data?
- Document-based
- Graph-based
- Column-based
- Key-value based
Answer: A) Document-based
Explanation:
PouchDB stores data in a document-based format.
3. Is PouchDB open-source?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, PouchDB is open-source.
4. While the application is offline with PouchDB, the data is saved locally in the browser using ____?
- WebSQL
- IndexedDB
- Both
Answer: C) Both
Explanation:
While the application is offline with PouchDB, the data is saved locally in the browser using WebSQL and IndexedDB.
5. You can create a database in PouchDB using the ____?
- PouchDB object
- PouchDB Tables
- PouchDB constructor
- PouchDB field
Answer: C) PouchDB constructor
Explanation:
You can create a database in PouchDB using the PouchDB constructor.
6. Which of the following method can get the basic information about the database?
- Info()
- Db_info()
- Information()
- databaseInfo()
Answer: A) Info()
Explanation:
info() method can get the basic information about the database.
7. Which of the following function may be used to delete a database in PouchDB?
- Db.delete()
- Db.remove()
- Db.del()
- Db.destroy()
Answer: D) Db.destroy()
Explanation:
PouchDB’s db.destroy() function may be used to delete a database.
8. With the ____ function, you can create a document in PouchDB.
- db.put()
- db.create()
- db.new()
Answer: A) db.put()
Explanation:
With the db.put() function, you can create a document in PouchDB.
9. With the ____ function, you can create an array (batch) of documents in PouchDB.
- db.bulkarray()
- db.bulkDocs()
- db.arraybulk()
Answer: B) db.bulkDocs()
Explanation:
With the db.bulkDocs() function, you can create an array (batch) of documents in PouchDB.
10. Which of the following method synchronizes data between multiple databases, either locally or remotely, using two-way replication?
- Synchronization()
- Synchro()
- Sync()
- Async()
Answer: C) Sync()
Explanation:
Sync() method synchronizes data between multiple databases, either locally or remotely, using two-way replication.
11. Which of the following method adds an attachment to a database document?
- Putattachment()
- Getattachment()
- Attachment()
Answer: A) Putattachment()
Explanation:
Putattachment() method adds an attachment to a database document.
12. Which of the following method fetches an attachment from a database document?
- Putattachment()
- Getattachment()
- Attachment()
Answer: B) Getattachment()
Explanation:
Getattachment() method fetches an attachment from a database document.
13. ____-method allows you to listen in real-time for changes to the database and trigger events depending on those changes.
- Listen()
- Changes()
- Listenchanges()
Answer: B) Changes()
Explanation:
Changes() method allows you to listen in real-time for changes to the database and trigger events depending on those changes.
14. ____- function returns all documents from the database or a subset of documents based on arguments like startkey, endkey, limit, and so on.
- Getdocs()
- Bulkdocs()
- Alldocs()
Answer: C) Alldocs()
Explanation:
alldocs() function returns all documents from the database or a subset of documents based on arguments like startkey, endkey, limit, and so on.
15. Which of the following browsers does PouchDB supports?
- Chrome 30+
- Safari 5+
- Internet Explorer 10+
- Opera 21+
- All of the above
Answer: E) All of the above
Explanation:
Following databases PouchDB supports:
- Chrome 30+
- Safari 5+
- Internet Explorer 10+
- Opera 21+
16. The ____ function may be used to minimize the size of a database by deleting unneeded data.
- compact()
- Reduce()
- Min()
- Minimize()
Answer: A) compact()
Explanation:
The compact() function may be used to minimize the size of a database by deleting unneeded data.
17. PouchDB functions like an app when offline, storing data locally.
- True
- False
Answer: A) True
Explanation:
PouchDB functions like an app when offline, storing data locally.
18. _rev in PouchDB is known as ____?
- Revision
- Revolution
- Revision maker
- Revision marker
Answer: D) Revision marker
Explanation:
_rev is known as a revision marker.
19. With the ____ function, you may delete a document from a PouchDB database.
- db.remove()
- db.destroy()
- db.remove()
- db.delete()
Answer: A) db.remove()
Explanation:
With the db.remove() function, you may delete a document from a PouchDB database.
20. What are the alternatives to PouchDB?
- SQLlite
- Realm
- MongoDB
- All of the above
Answer: D) All of the above
Explanation:
Following are the alternatives to PouchDB:
- SQLlite
- Realm
- MongoDB