Make one MCQ for each sufficiently-important topic of the following text.:
get(key)
Returns an Array of all Objects that match the given key in their _id field or the field specified by indexBy. If no document with that key exists, this returns an empty array.

const profile = db.get('shamb0t')
// [{ _id: 'shamb0t', name: 'shamb0t', followers: 500 }]
// to get all the records
const profile = db.get('');
// returns all the records
// [{ _id: 'shamb0t', name: 'shamb0t', followers: 500 }]
query(mapper)
Returns an Array of Objects based on the mapper.

const all = db.query((doc) => doc.followers >= 500)
// [{ _id: 'shamb0t', name: 'shamb0t', followers: 500 }]
del(key)
Returns a Promise that resolves to the multihash of the entry as a String.

const hash = await db.del('shamb0t')
orbitdb.docstore(name|address, options)
Alias for orbitdb.docs()

orbitdb.counter(name|address)
Creates and opens a counter database

Returns a Promise that resolves to a CounterStore instance.

const counter = await orbitdb.counter('song_123.play_count')
// Or:
const counter = await orbitdb.counter(anothercounterdb.address)
Module: orbit-db-counterstore.

See the Store section for details of common methods and properties.

value
Returns a Number.

counter.value // 0
inc([value])
Returns a Promise that resolves to the multihash of the entry as a String.

await counter.inc()
counter.value // 1
await counter.inc(7)
counter.value // 8
await counter.inc(-2)
counter.value // 8
Static Properties
OrbitDB.databaseTypes
Returns supported database types (i.e. store types) as an Array of Strings

OrbitDB.databaseTypes
// [ 'counter', 'eventlog', 'feed', 'docstore', 'keyvalue']
Static Methods
OrbitDB.createInstance(ipfs)
Returns a Promise that resolved to an instance of OrbitDB.

const orbitdb = await OrbitDB.createInstance(ipfs)
OrbitDB.isValidType(type)
Returns true if the provided String is a supported database type

OrbitDB.isValidType('docstore')
// true
OrbitDB.addDatabaseType(type, store)
Adds a custom database type & store to OrbitDB

import CustomStore from './CustomStore'
OrbitDB.addDatabaseType(CustomStore.type, CustomStore)
OrbitDB.getDatabaseTypes()
Returns an Object mapping database types to Store Classes

OrbitDB.getDatabaseTypes()
// { counter: [Function: CounterStore],
//  eventlog: [Function: EventStore],
//  feed: [Function: FeedStore],
//  docstore: [Function: DocumentStore],
//  keyvalue: [Function: KeyValueStore] }
OrbitDB.isValidAddress(address)
Returns true if the provided String is a valid OrbitDB address

OrbitDB.isValidAddress('/orbitdb/Qmdgwt7w4uBsw8LXduzCd18zfGXeTmBsiR8edQ1hSfzcJC/first-database')
// true
OrbitDB.parseAddress(address)
Returns an instance of OrbitDBAddress if the provided String is a valid orbitdb address

OrbitDB.parseAddress('/orbitdb/Qmdgwt7w4uBsw8LXduzCd18zfGXeTmBsiR8edQ1hSfzcJC/first-database')
// OrbitDBAddress {
//  root: 'Qmdgwt7w4uBsw8LXduzCd18zfGXeTmBsiR8edQ1hSfzcJC',
//  path: 'first-database' }
Store API
Every database (store) has the following methods available in addition to their specific methods.

store.load([amount], { fetchEntryTimeout })
Load the locally persisted database state to memory. Use the optional amount argument to limit the number of entries loaded into memory, starting from the head(s) (Default: -1 will load all entries). fetchEntryTimeout defines the timeout for fetching an entry.

Returns a Promise that resolves once complete

With events:

db.events.on('ready', () => {
  /* database is now ready to be queried */
})
db.load()
Async:

await db.load()
/* database is now ready to be queried */
store.close()
Close the database. Returns a Promise that resolves once complete

Async:

await db.close()
store.drop()
Remove the database locally. This does not delete any data from peers.

Returns a Promise that resolves once complete

await db.drop()
store.identity
Returns an instance of Identity. The identity is used to sign the database entries. See the GUIDE for more information on how OrbitDB uses identity.

const identity = db.identity
console.log(identity.toJSON())
{ id: 'QmZyYjpG6SMJJx2rbye8HXNMufGRtpn9yFkdd27uuq6xrR',
  publicKey: '0446829cbd926ad8e858acdf1988b8d586214a1ca9fa8c7932af1d59f7334d41aa2ec2342ea402e4f3c0195308a4815bea326750de0a63470e711c534932b3131c',
  signatures:
   { id: '3045022058bbb2aa415623085124b32b254b8668d95370261ade8718765a8086644fc8ae022100c736b45c6b2ef60c921848027f51020a70ee50afa20bc9853877e994e6121c15',
     publicKey: '3046022100d138ccc0fbd48bd41e74e40ddf05c1fa6ff903a83b2577ef7d6387a33992ea4b022100ca39e8d8aef43ac0c6ec05c1b95b41fce07630b5dc61587a32d90dc8e4cf9766'
   },
  type: 'orbitdb'
}
The public key can be retrieved with:

console.log(db.identity.publicKey)
// 0446829cbd926ad8e858acdf1988b8d586214a1ca9fa8c7932af1d59f7334d41aa2ec2342ea402e4f3c0195308a4815bea326750de0a63470e711c534932b3131c
The key can also be accessed from the OrbitDB instance: orbitdb.identity.publicKey.

store.type
Returns the type of the database as a String.

Store Events
Each database in orbit-db contains an events (EventEmitter) object that emits events that describe what's happening in the database. Events can be listened to with:

db.events.on(name, callback)
replicated
db.events.on('replicated', (address) => ... )
Emitted when the database has synced with another peer. This is usually a good place to re-query the database for updated results, eg. if a value of a key was changed or if there are new events in an event log.

replicate
db.events.on('replicate', (address) => ... )
Emitted before replicating a part of the database with a peer.

replicate.progress
db.events.on('replicate.progress', (address, hash, entry, progress, have) => ... )
Emitted while replicating a database. address is id of the database that emitted the event. hash is the multihash of the entry that was just loaded. entry is the database operation entry. progress is the current progress. have is a map of database pieces we have.

load
db.events.on('load', (dbname) => ... )
Emitted before loading the database.

load.progress
db.events.on('load.progress', (address, hash, entry, progress, total) => ... )
Emitted while loading the local database, once for each entry. dbname is the name of the database that emitted the event. hash is the multihash of the entry that was just loaded. entry is the database operation entry. progress is a sequential number starting from 0 upon calling load().

ready
db.events.on('ready', (dbname, heads) => ... )
Emitted after fully loading the local database.

write
db.events.on('write', (address, entry, heads) => ... )
Emitted after an entry was added locally to the database. hash is the IPFS hash of the latest state of the database. entry is the added database op.

peer
db.events.on('peer', (peer) => ... )
Emitted when a new peer connects via ipfs pubsub. peer is a string containing the id of the new peer

closed
Emitted once the database has finished closing.

db.events.on('closed', (dbname) => ... )
peer.exchanged
db.events.on('peer.exchanged', (peer, address, heads) => ... )
Emitted after heads have been exchanged with a peer for a specific database. This will be emitted after every exchange, even if no heads are received from the peer, or if all received heads are already present. (This is in contrast with the replicated event, which will only fire when new heads have been received.) Note that heads here contains heads received as part of the exchange, not heads sent.

Oplog API
Oplog or IPFS-Log is the underlying data structure used by the OrbitDB Stores to store, replicate and add operations to any of their stores.

oplog.values
An Array of operations sorted by how they happened in ascending order. If an operation A is before B, A is before B in the Array.

Each oplog entry contains these fields:

 {
    hash: 'zdpuAuARU9C1MXvHGozGxvpv3rvSzghQg7JmoLQLWbedJzcd7',
    id: '/orbitdb/zdpuArEpCPwqpgQVMYrFSDQKhHLq5L6Es8HQkhWfhrad5oYdK/example',
    payload: { op: 'PUT', key: 'abc', value: 'def' },
    next: [ 'zdpuAzWC4phgt6eQeRPz58p33G1w1J5ciVnCwuoFa7szsDVP2' ],
    refs: [ 'zdpuAxFR9miMinzetRdZKvy9mBaiZLJByA6DV715Wcmgi7dwx' ],
    v: 2,
    clock: LamportClock {
      id: '04f75c96cb240d8b254df96fcc7d9d7a1260fd838cb0d085f009d2f0c78b74f7984c168da6afa1f0ee9400f5022952e70955c10798beb0c168966faf746c7202ad',
      time: 3
    },
    key: '04f75c96cb240d8b254df96fcc7d9d7a1260fd838cb0d085f009d2f0c78b74f7984c168da6afa1f0ee9400f5022952e70955c10798beb0c168966faf746c7202ad',
    identity: {
      id: '0336124289bdb2384ef7f3f5991d25bb1e02bf2a98edb02f94b0bc9f292c41156b',
      publicKey: '04f75c96cb240d8b254df96fcc7d9d7a1260fd838cb0d085f009d2f0c78b74f7984c168da6afa1f0ee9400f5022952e70955c10798beb0c168966faf746c7202ad',
      signatures: [Object],
      type: 'orbitdb'
    },
    sig: '3045022100e618887439bcaa8cffe0196d5655c710cc117af7de4390a313d137dd02a993a402205fb0b657600216944a0e7f68d2bb07854e8f47cc01a74d7cc632870ad7055758'
  }
Let's got through each of them in turn:

hash
Hash of the entry on IPFS. "zd...".

id
Address of the oplog. (A.k.a. the OrbitDB Address)

payload
Payload of the operation. Provided by the Store to _addOperation.

next
Array of hashes of the oplog entries that happened before this one.

refs
TBD

v
TBD

clock
Lamport clock instance of the entry. A Lamport clock contains a time, an integer, that for all operations depending on each other increases.

If Operation A depends on Operation B, B's time < A's time.

See the Wikipedia description of Lamport Clocks for more details

key
Public key of the Identity that added this entry.

identity
Identity that added this entry.

sig
Signature of the entry. If the entry is in the oplog, the signature is valid.