Published
Edited
Aug 1, 2022
1 star
Insert cell
Insert cell
db = new gunnery()
Insert cell
pub = await db.auth( "alias", "password")
Insert cell
Insert cell
db2 = new gunnery()
Insert cell
pub2 = await db2.auth( "alias2", "password2")
Insert cell
Insert cell
data = pub, pub2, ({ example: 1 })
Insert cell
Insert cell
op1 = await db.put( data, "key1", "key2")
Insert cell
my_data = op1, await db.get( "key1", "key2")
Insert cell
Insert cell
user_data = op1, await db.uget( pub2, "key1", "key2")
Insert cell
Insert cell
op2 = await db.gput( data, "key1", "key2")
Insert cell
public_data = op2, await db.gget( "key1", "key2")
Insert cell
Insert cell
op3 = pub, await db.put( data, "key1", "key2", {enc: true})
Insert cell
enc_data = op3, await db.get( "key1", "key2", {enc: true})
Insert cell
Insert cell
op4 = await db.gput( data, "key1", "key2", {enc: pub2})
Insert cell
enc_data2 = op4, await db2.gget( "key1", "key2", {enc: true})
Insert cell
Insert cell
op5 = await db.gput( data, "#", "", {hash: true})
Insert cell
op6 = await db.gput( data, "#inbox", "2021/August#", {hash: true})
Insert cell
Insert cell
myDataColl = []
Insert cell
myDataMapper = op1, await db.map( "key1", async (data) => {
myDataColl.push( data)
})
Insert cell
Insert cell
myListenerData = []
Insert cell
myListener = op1, await db.on( "key1", "key2", async (data) => {
myListenerData.push( data)
})
Insert cell
Insert cell
page = op1, await db.page( "key1")
Insert cell
op7 = await page.put( "key2", data)
Insert cell
p1 = await page.next()
Insert cell
p2 = await page.next()
Insert cell
p3 = await page.next()
Insert cell
Insert cell
gunnery = (await import('https://cdn.skypack.dev/gunnery@0.0.15?min')).default
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more