Google News
logo
PouchDB - Quiz(MCQ)

PouchDB : PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

PouchDB was created to help web developers build applications that work as well offline as they do online.

PouchDB is an in-browser database that allows applications to save data locally, so that users can enjoy all the features of an app even when they're offline. Plus, the data is synchronized between clients, so users can stay up-to-date wherever they go.

PouchDB also runs in Node.js and can be used as a direct interface to CouchDB-compatible servers. The API works the same in every environment, so you can spend less time worrying about browser differences, and more time writing clean, consistent code.

A)
A CSS framework
B)
A programming language
C)
A server-side technology
D)
A JavaScript database library

Correct Answer :   A JavaScript database library


Explanation : PouchDB is a JavaScript database library that can be used in web and mobile applications to store and manage data.

A)
SQL
B)
NoSQL
C)
Graph
D)
Relational

Correct Answer :   NoSQL


Explanation : PouchDB uses a NoSQL database by default, specifically the Apache CouchDB database.

A)
Graph-based
B)
Column-based
C)
Document-based
D)
Key-value based

Correct Answer :   Document-based


Explanation : PouchDB stores data in a document-based format.

A)
Yes
B)
No
C)
Can Not Say
D)
None of the above

Correct Answer :   Yes


Explanation : Yes, PouchDB is open-source.

A)
Querying
B)
Animation
C)
Replication
D)
Authentication

Correct Answer :   Animation


Explanation : PouchDB does not have built-in support for animation.

A)
Only works with small datasets
B)
Easy integration with only one framework
C)
Can sync data between clients and servers
D)
Limited flexibility and customization options

Correct Answer :   Can sync data between clients and servers


Explanation : PouchDB provides the ability to sync data between clients and servers, which is a major benefit for applications that need offline functionality.

A)
WebSQL
B)
IndexedDB
C)
Both (A) and (B)
D)
None of the above

Correct Answer :   Both (A) and (B)


Explanation : While the application is offline with PouchDB, the data is saved locally in the browser using WebSQL and IndexedDB.

A)
PouchDB field
B)
PouchDB Tables
C)
PouchDB object
D)
PouchDB constructor

Correct Answer :   PouchDB constructor


Explanation : You can create a database in PouchDB using the PouchDB constructor.

A)
Info()
B)
Db_info()
C)
Information()
D)
databaseInfo()

Correct Answer :   Info()


Explanation : info() method can get the basic information about the database.

A)
As a client-side database
B)
As a server-side database
C)
Both (A) and (B)
D)
None of the above

Correct Answer :   Both (A) and (B)


Explanation : PouchDB can be used as both a client-side and server-side database in a web application.

A)
To retrieve a specific document by ID
B)
To listen for changes to the database
C)
To retrieve all documents in the database
D)
To delete a document from the database

Correct Answer :   To listen for changes to the database


Explanation : PouchDB’s “changes” API allows you to listen for changes to the database in real-time, such as when a new document is added or an existing document is updated or deleted.

A)
var db = new PouchDB(“mydb”);
B)
var db = new Database(“mydb”);
C)
var db = createPouchDB(“mydb”);
D)
var db = PouchDB.create(“mydb”);

Correct Answer :   var db = new PouchDB(“mydb”);


Explanation : The syntax for creating a new instance of PouchDB is “var db = new PouchDB(‘mydb’)”.

A)
find()
B)
insert()
C)
query()
D)
allDocs()

Correct Answer :   db.insert()


Explanation : The “db.insert()” method is not used for querying data in PouchDB, but rather for inserting new documents into the database.

A)
Db.del()
B)
Db.delete()
C)
Db.remove()
D)
Db.destroy()

Correct Answer :   Db.destroy()


Explanation : PouchDB's db.destroy() function may be used to delete a database.

A)
db.new()
B)
db.create()
C)
db.put()
D)
None of the above

Correct Answer :   db.put()


Explanation : With the db.put() function, you can create a document in PouchDB.

A)
db.arraybulk()
B)
db.bulkarray()
C)
db.bulkDocs()
D)
None of the above

Correct Answer :   db.bulkDocs()


Explanation : With the db.bulkDocs() function, you can create an array (batch) of documents in PouchDB.

17 .
Which of the following method synchronizes data between multiple databases, either locally or remotely, using two-way replication?
A)
Sync()
B)
Async()
C)
Synchro()
D)
Synchronization()

Correct Answer :   Sync()


Explaination : Sync() method synchronizes data between multiple databases, either locally or remotely, using two-way replication.

A)
Use the “limit” method
B)
Use the “skip” method
C)
Use the “sort” method
D)
Use the “filter” method

Correct Answer :   Use the “limit” method


Explanation : The “limit” method can be used to limit the number of documents returned by a PouchDB query.

A)
To backup and restore a database
B)
To copy a database to a new location
C)
To compress data stored in the database
D)
To synchronize data between two or more databases

Correct Answer :   To synchronize data between two or more databases


Explanation : PouchDB’s “replication” feature allows you to synchronize data between two or more databases, making it easy to keep data consistent across multiple devices or servers.

A)
One-way replication
B)
Two-way replication
C)
Three-way replication
D)
Multi-master replication

Correct Answer :   Three-way replication


Explanation : “Three-way replication” is not a type of PouchDB replication.

A)
To update the schema of the database
B)
To resolve conflicts that occur during replication
C)
To delete documents from the database
D)
To retrieve a list of all documents in the database

Correct Answer :   To resolve conflicts that occur during replication


Explanation : PouchDB’s “conflicts” API allows you to resolve conflicts that occur during replication, such as when the same document is modified on two different devices.

A)
Attachment()
B)
Putattachment()
C)
Getattachment()
D)
None of the above

Correct Answer :   Putattachment()


Explanation : Putattachment() method adds an attachment to a database document.

A)
Getattachment()
B)
Attachment()
C)
Putattachment()
D)
All of the above

Correct Answer :   Getattachment()


Explanation : Getattachment() method fetches an attachment from a database document.

24 .
______-method allows you to listen in real-time for changes to the database and trigger events depending on those changes.
A)
Changes()
B)
Listen()
C)
Listenchanges()
D)
None of the above

Correct Answer :   Changes()


Explaination : Changes() method allows you to listen in real-time for changes to the database and trigger events depending on those changes.

25 .
_____- function returns all documents from the database or a subset of documents based on arguments like startkey, endkey, limit, and so on.
A)
Getdocs()
B)
Bulkdocs()
C)
Alldocs()
D)
None of the above

Correct Answer :   Alldocs()


Explaination : alldocs() function returns all documents from the database or a subset of documents based on arguments like startkey, endkey, limit, and so on.

A)
replicate(from, to)
B)
replicate.to(from)
C)
replicate.all(from, to)
D)
sync(from, to)

Correct Answer :   sync(from, to)


Explanation : The syntax for initiating a replication in PouchDB is “db.sync(from, to)”.

A)
Chrome 30+
B)
Safari 5+
C)
Internet Explorer 10+
D)
All of the above

Correct Answer :   All of the above


Explanation : Following databases PouchDB supports :

* Chrome 30+
* Safari 5+
* Internet Explorer 10+
* Opera 21+

A)
Min()
B)
Reduce()
C)
compact()
D)
Minimize()

Correct Answer :   compact()


Explanation : The compact() function may be used to minimize the size of a database by deleting unneeded data.

A)
Revision
B)
Revision marker
C)
Revolution
D)
Revision maker

Correct Answer :   Revision marker


Explanation : _rev is known as a revision marker.

A)
db.remove()
B)
db.delete()
C)
db.remove()
D)
db.destroy()

Correct Answer :   db.remove()


Explanation : With the db.remove() function, you may delete a document from a PouchDB database.

A)
By caching all data in the browser
B)
By using a browser plugin to cache data
C)
By relying on the browser’s built-in offline mode
D)
By using a service worker to intercept network requests

Correct Answer :   By using a service worker to intercept network requests


Explanation : By using a service worker to intercept network requests, you can use PouchDB to cache and manage data locally, allowing your web application to function offline-first.

A)
To compress data stored in the database
B)
To stream data from the database in real-time
C)
To limit the amount of data returned by a query
D)
To retrieve data from the database on a set interval

Correct Answer :   To stream data from the database in real-time


Explanation : PouchDB’s “live” API allows you to stream data from the database in real-time, so that any changes to the database are immediately reflected in the client.

A)
To encrypt data stored in the database
B)
To delete documents from the database
C)
To add images or other files to a document
D)
To compress data stored in the database

Correct Answer :   To add images or other files to a document


Explanation : PouchDB’s “attachments” API allows you to add images or other files to a document in the database.

A)
Native UI components
B)
Offline data access
C)
Cross-platform compatibility
D)
Synchronization between devices

Correct Answer :   Native UI components


Explanation : PouchDB is not designed to provide native UI components for mobile applications.

A)
Realm
B)
SQLlite
C)
MongoDB
D)
All of the above

Correct Answer :   All of the above


Explanation : Following are the alternatives to PouchDB :

* SQLlite
* Realm
* MongoDB

A)
js
B)
iOS
C)
Android
D)
Web browsers

Correct Answer :   iOS


Explanation : While PouchDB can be used with iOS through web views, it is not specifically designed for iOS.

A)
To optimize database queries for better performance
B)
To query a database without updating the results as the data changes
C)
To perform complex queries that cannot be done with standard database tools
D)
To run live queries on a database and receive real-time updates as the data changes

Correct Answer :   To run live queries on a database and receive real-time updates as the data changes


Explanation : PouchDB’s “Live Query” plug-in allows you to run live queries on a database and receive real-time updates as the data changes.

38 .
What is the syntax for using the PouchDB 'Replication Sync' plug-in to replicate data between two databases?
A)
copy(source, target)
B)
transfer(source, target)
C)
sync(source, target)
D)
replicate(source, target)

Correct Answer :   sync(source, target)


Explaination : The syntax for using the PouchDB “Replication Sync” plug-in to replicate data between two databases is “db.sync(source, target)”.

A)
To replicate data between databases using HTTP requests
B)
To replicate data between databases using streams
C)
To replicate data between databases using Bluetooth
D)
To replicate data between databases using web sockets

Correct Answer :   To replicate data between databases using HTTP requests


Explanation : PouchDB’s “Replication Sync” plug-in allows you to replicate data between databases using HTTP requests.

A)
lock(password)
B)
secure(password)
C)
encrypt(password)
D)
protect(password)

Correct Answer :   db.encrypt(password)


Explanation : The syntax for encrypting a database with the PouchDB “Encryption” plug-in is “db.encrypt(password)”.

A)
To encrypt data stored in the database
B)
To create indexes for fast queries
C)
To delete documents from the database
D)
To compress data stored in the database

Correct Answer :   To create indexes for fast queries


Explanation : PouchDB’s “index” API allows you to create indexes for fast queries on specific fields in the database.

A)
index(indexName, fieldName)
B)
create(indexName, fieldName)
C)
createIndex(indexName, fieldName)
D)
index.create(indexName, fieldName)

Correct Answer :   db.createIndex(indexName, fieldName)


Explanation : The syntax for creating a PouchDB index is “db.createIndex(indexName, fieldName)”.

A)
To encrypt data stored in the database
B)
To delete documents from the database
C)
To compress data stored in the database
D)
To transform and filter data returned by queries

Correct Answer :   To transform and filter data returned by queries


Explanation : PouchDB’s “map/reduce” functions allow you to transform and filter data returned by queries, allowing for more powerful and flexible data processing.

A)
map(mapFunction, reduceFunction)
B)
query(mapFunction, reduceFunction)
C)
reduce(mapFunction, reduceFunction)
D)
mapReduce(mapFunction, reduceFunction)

Correct Answer :   db.mapReduce(mapFunction, reduceFunction)


Explanation : The syntax for querying a PouchDB database using a map/reduce function is “db.mapReduce(mapFunction, reduceFunction)”.

A)
submit
B)
error
C)
change
D)
complete

Correct Answer :   submit


Explanation : “Submit” is not a PouchDB event.

A)
copy(source, target)
B)
sync(source, target)
C)
replicate(source, target)
D)
transfer(source, target)

Correct Answer :   sync(source, target)


Explanation : The syntax for replicating a PouchDB database is “db.sync(source, target)”.

A)
To delete multiple documents from the database
B)
To compress multiple documents in the database
C)
To retrieve multiple documents from the database
D)
To insert or update multiple documents in the database

Correct Answer :   To insert or update multiple documents in the database


Explanation : PouchDB’s “bulkDocs” API allows you to insert or update multiple documents in the database at once, which can be more efficient than inserting or updating them one at a time.

A)
By importing data from a CSV file
B)
By replicating an existing database
C)
By instantiating a new PouchDB object
D)
By creating a new CouchDB database and syncing it with PouchDB

Correct Answer :   By importing data from a CSV file


Explanation : While you can import data from a CSV file into a PouchDB database, this is not a way to create a new PouchDB database.

A)
RSA
B)
AES-128
C)
AES-256
D)
SHA-256

Correct Answer :   AES-256


Explanation : The PouchDB “Encryption” plug-in uses the AES-256 encryption algorithm.

A)
To replicate data between databases
B)
To encrypt data stored in the database
C)
To provide secure authentication for users
D)
To compress a database to save disk space

Correct Answer :   To encrypt data stored in the database


Explanation : PouchDB’s “Encryption” plug-in allows you to encrypt data stored in the database.

A)
convert(source, target)
B)
migrate(source, target)
C)
migrateData(source, target)
D)
transferData(source, target)

Correct Answer :   db.migrate(source, target)


Explanation : The syntax for using the PouchDB “Migrate” plug-in to migrate data between database formats is “db.migrate(source, target)”.

A)
To migrate data between different database formats
B)
To migrate data between different databases
C)
To migrate data from a local database to a remote database
D)
To migrate data from a remote database to a local database

Correct Answer :   To migrate data between different database formats


Explanation : PouchDB’s “Migrate” plug-in allows you to migrate data between different database formats, such as from one version of PouchDB to another.

A)
insert(doc)
B)
update(doc)
C)
Both (A) and (B)
D)
upsert(doc)

Correct Answer :   db.upsert(doc)


Explanation : The syntax for using the PouchDB “Upsert” plug-in to insert or update a document is “db.upsert(doc)“.

A)
To delete documents from the database
B)
To insert new documents into the database
C)
To update existing documents in the database
D)
To insert or update documents in the database based on their existing state

Correct Answer :   To insert or update documents in the database based on their existing state


Explanation : PouchDB’s “Upsert” plug-in allows you to insert or update documents in the database based on their existing state, rather than just inserting new documents or updating existing ones.

A)
To compress a database to save disk space
B)
To provide secure authentication for users
C)
To replicate data between databases using streams
D)
To monitor changes to the database in real-time

Correct Answer :   To replicate data between databases using streams


Explanation : PouchDB’s “Replication Stream” plug-in allows you to replicate data between databases using streams, which can be more efficient than using the standard replication API.

A)
Reduced memory usage
B)
Improved data compression
C)
Improved replication speed
D)
Improved network efficiency

Correct Answer :   Improved data compression


Explanation : While using streams can improve replication speed, reduce memory usage, and improve network efficiency, it does not improve data compression.

A)
signup(username, password)
B)
create(username, password)
C)
newUser(username, password)
D)
addUser(username, password)

Correct Answer :   db.signup(username, password)


Explanation : The syntax for creating a new user with the PouchDB “Authentication” plug-in is “db.signup(username, password)”.

A)
To backup a database to a file
B)
To permanently delete a database
C)
To empty a database of all documents
D)
To compress a database to save disk space

Correct Answer :   To permanently delete a database


Explanation : PouchDB’s “destroy” API allows you to permanently delete a database, removing it from the file system.

A)
To create indexes for fast queries
B)
To replicate data between databases
C)
To provide a simplified query syntax
D)
To monitor changes to the database in real-time

Correct Answer :   To provide a simplified query syntax


Explanation : PouchDB’s “Find” plug-in provides a simplified query syntax for querying the database.

A)
query(query)
B)
filter(query)
C)
search(query)
D)
find(query)

Correct Answer :   db.find(query)


Explanation : The syntax for using the PouchDB “Find” plug-in to query a database is “db.find(query)”.