Optional
init: S3DatastoreInitPrivate
Readonly
bucketOptional
pathPrivate
Readonly
s3Extending classes should override query
or implement this method
Optional
options: AbortOptionsExtending classes should override queryKeys
or implement this method
Optional
options: AbortOptionsReturns the full key which includes the path to the ipfs store
Recursively fetches all keys from s3
Optional
Prefix?: stringOptional
StartOptional
options: AbortOptionsThis will return an object with which you can chain multiple operations together, with them only being executed on calling commit
.
const b = store.batch()
for (let i = 0; i < 100; i++) {
b.put(new Key(`hello${i}`), new TextEncoder('utf8').encode(`hello world ${i}`))
}
await b.commit()
console.log('put 100 values')
Delete the record under the given key
Optional
options: AbortOptionsRemove values for the passed keys
Optional
options: AbortOptionsconst source = [new Key('awesome')]
for await (const key of store.deleteMany(source)) {
console.log(`deleted content with key ${key}`)
}
Read from s3
Optional
options: AbortOptionsRetrieve values for the passed keys
Optional
options: AbortOptionsfor await (const { key, value } of store.getMany([new Key('awesome')])) {
console.log(`got "${key}" = "${new TextDecoder('utf8').decode(value)}"`')
// => got "/awesome" = "datastore"
}
Check for the existence of the given key
Optional
options: AbortOptionsThis will check the s3 bucket to ensure access and existence
Optional
options: AbortOptionsStore the given value under the key.
Optional
options: AbortOptionsStore the given key/value pairs
Optional
options: AbortOptionsconst source = [{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }]
for await (const { key, value } of store.putMany(source)) {
console.info(`put content for key ${key}`)
}
Query the datastore.
Optional
options: AbortOptions// retrieve __all__ key/value pairs from the store
let list = []
for await (const { key, value } of store.query({})) {
list.push(value)
}
console.log('ALL THE VALUES', list)
Query the datastore.
Optional
options: AbortOptions// retrieve __all__ keys from the store
let list = []
for await (const key of store.queryKeys({})) {
list.push(key)
}
console.log('ALL THE KEYS', key)
A datastore backed by AWS S3