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

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more