-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
46 lines (38 loc) · 851 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const fs = require('fs-extra')
fs.removeSync('data.json')
const Gun = require('gun')
const gun = Gun()
require('./index')({
log: true
})
gun.get('test').map().load(doc => {
console.log('completed obj:', JSON.stringify(doc, null, 2))
})
let ref = gun.get('rel-data').put({
value: 123,
relation: {
relation2: {
relation3: {
relation4: {
hello: 'world',
blab: 1334,
blbobboadfdf: false
}
}
}
}
})
gun.get('rel-data').path('relation.relation2.relation3').set({
what: 'is this'
})
gun.get('test').set(ref)
// gun.get('test').set(null)
// gun.get('test').set({
// hello: 'world'
// })
//
// gun.get('test').set({
// hellooo: 'again'
// })
//
// gun.get('test').path('hello').put(null)