Questions tagged [gun]

GUN (a.k.a GUNdb, GUNjs) is a real-time, distributed, offline-first, graph database engine.

GUN (Graph. Universe. Node.) is a JavaScript database that is like an Open Source Firebase. If you need help or if you are stuck on a bug, problem, or are confused - just give us a shout by posting your question.

Project site: gundb.io
Source code at: github.com/amark/gun
Chat room: gitter.im/amark/gun

150 questions
2
votes
1 answer

How would you build a p2p twitter clone with GunDB?

GunDB is supposed to support peer-to-peer data access, so I'm trying to better understand how this would work. If I were to build a twitter clone, what would the high-level architecture look like if I wanted each user to store their own tweets on…
soundly_typed
  • 39,257
  • 5
  • 28
  • 36
2
votes
2 answers

How do you do pagination in GUN?

How do you do something like gun.get({startkey, endkey}) ? Previously: https://github.com/amark/gun/issues/479
marknadal
  • 7,534
  • 4
  • 25
  • 22
2
votes
2 answers

How can a number of angular clients communicate between themselves even when they lose connection to a central server?

So the scenario is like this... I have a number of different users in an organization. Each has his own session of an AngularJS app running in their browser. They share an internet connection over a local LAN. I need them to continue working…
Jalal El-Shaer
  • 14,502
  • 8
  • 45
  • 51
2
votes
1 answer

Unity3D multiplayer game using GunDB

I usually using firebase for syncing every player for my multiplayer game but this time I can't because this time I want create a desktop game and firebase only support mobile. can I use Gundb as alternative to store the player position and…
alucard555
  • 21
  • 5
2
votes
0 answers

Method .map().val(cb) does not return every object once

gun 0.8.9, Node.js In the API reference written users.map().val(cb) gets each user once, including ones that are added over time. But for me, it returns duplicates starting from the second run. The more I run the script, the more duplicates I…
srgbnd
  • 5,404
  • 9
  • 44
  • 80
2
votes
1 answer

Can't delete a node from the root level

gun 0.8.8, Node.js-to-Node.js, Node.js-to-browser Create a node (Node.js) let node = gun.get(`watcher/f0de26c0-a29f-11e7-8661-154b982951a4`); node.put({ stats: { num: 13 }, name: 'trex' }); Delete the node (Node.js) node.put(null); Check…
srgbnd
  • 5,404
  • 9
  • 44
  • 80
2
votes
1 answer

Only a node can be linked! Not "undefined"!

I want to put nodes in Gun set. const Gun = require('gun'); const _ = require('lodash'); require( "gun/lib/path" ); const gun = new Gun({peers:['http://localhost:8080/gun']}); const watchers = [ { _id: '123', _type: 'skeleton', …
srgbnd
  • 5,404
  • 9
  • 44
  • 80
2
votes
3 answers

How do I wire Gun to update all React clients without a central server?

Here's a link to a basic code pen that syncs an tag with a Gun instance, and wires Gun updates to React setState. https://codepen.io/anon/pen/weJxNO?editors=0011 What I expect: When you open the program in several windows, you can type in…
Joseph Fraley
  • 1,360
  • 1
  • 10
  • 26
2
votes
1 answer

How to make sure client doesn't sync when switching from dev to live server

When I change the url in the client from localhost to myLiveServer.com, how do I make sure that the localStorage doesn't get synced with the live data? Do I need to configure that somewhere and extend the url like... localhost:8080/gun/dev and…
Jingle
  • 573
  • 3
  • 15
2
votes
2 answers

Using map to reduce in Gun

I am new to Gun. I have existing code that very effectively reduces an array of objects based on a pattern. I am thinking I should tweak this to run in the context of Gun's .map and return undefined for non-matches. I think I will also have to…
AnyWhichWay
  • 716
  • 8
  • 11
2
votes
1 answer

Is it expected behaviour for "map" to return a node multiple times? (i.e. duplicates)

I was experimenting with using gun in a server side rendering (SSR) context and noticed that I began to receive duplicate items in the map callback. The duplicate count was n, where n was the number of times I had refreshed the page. I did some…
ctrlplusb
  • 12,847
  • 6
  • 55
  • 57
2
votes
1 answer

how to get the whole list object variables and arrays without need to get from object child id gundb?

I just notice that object child of object has id but not that I wanted that when I try to get the object variable. I wanted what store in object of object but I found id only? For example I used scene manage the objects to save and load for easy…
Lightnet
  • 61
  • 1
  • 6
2
votes
1 answer

How do I pass a subdirectory path to the GunDB S3 storage driver so the same S3 bucket can be shared with non-Gun data?

I see examples referencing a few parameters for the S3 storage driver for GunDB that look like this: var Gun = require('gun'); var gun = Gun({ file: 'data.json', s3: { key: '', // AWS Access Key secret: '', // AWS…
hillct
  • 33
  • 5
2
votes
1 answer

Warning message on GunDB bootup

There's a warning message when GunDB starts WARNING! This file.js module for gun is intended only for local development testing! It doesn't appear to have any negative effect... But it's kinda freaking out the DevOps guys I'm working with. Is…
Jamie Popkin
  • 139
  • 1
  • 4
2
votes
0 answers

GunDB peers option

I'm not sure I understand how to configure the gunDB servers in the constructor. This is what I'm trying to do: var gunOptions = { file: 'data.json', peers: ['host1.com','host2.com'] } bucket = new gun(gunOptions); When I do this I get lots of…
Jamie Popkin
  • 139
  • 1
  • 4