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
4
votes
1 answer

How to use Gun as an express route?

I'm trying to use gun in an express/node project, however I want to mount the endpoint as /db. I had hoped the following code would work but keep getting a Route.get() requires callback functions error: var express = require('express'); var Gun =…
John Doherty
  • 3,669
  • 36
  • 38
4
votes
1 answer

How to build react SPA with GunDb on nodejs

I really like concept of GunDb, and understand how to write in client side alone. Now I use Create-React-App from Github. Dose anyone know server side for GunDb? and a View [React Gun library] ; example 'socket.io-client' So I can run es6…
riseres
  • 3,004
  • 4
  • 28
  • 40
4
votes
1 answer

How do I delete data in gun DB when path has multiple objects

How do I delete data when my path contains multiple objects? gun.path('saving_accounts').put(null) would delete all savings accounts. Or, do you have a way to handle the null errors when iterating over data that has a 'deleted' object? I'm providing…
jtlindsey
  • 4,346
  • 4
  • 45
  • 73
4
votes
1 answer

Duplicate console.log output of gun map when using gundb

Does this function duplicate results as a bug or am I causing this? The output always has 1 or more records duplicated. In this example, Bank of China is always listed twice in output. gun.get('savings_accounts').map(function (name, ID) { …
jtlindsey
  • 4,346
  • 4
  • 45
  • 73
4
votes
1 answer

JWT authentication with gundb

Can i use JWT authentication with gundb? And if so, would it dramatically slow down my sync speed? I was going to try and implement a test using the tutorial here but wanted to see if there were any 'gotchas' I should be aware of.
jtlindsey
  • 4,346
  • 4
  • 45
  • 73
4
votes
2 answers

Gun.js why do I get the error "You have no persistence layer to save to error"

I'm trying out gun.js I have it installed as a node.js project, I have configured the amazon S3 bucket through the dotenv and I have tried adding a data.json file and still I cant get gun.js to save the file locally or to he S3 bucket. I know its…
Bill
  • 4,614
  • 13
  • 77
  • 132
3
votes
1 answer

Why Gun.js duplicate messages in ReactJs

I'm implementing gun.js in react application.But messages are duplicated on each render, and on each update. Can someone help to figure out what's wrong with my code. this my code . import Gun from "gun/gun"; import { IGunChain, IGunInstance } from…
Jonathz
  • 33
  • 4
3
votes
1 answer

Simple examples of public space, user space, and frozen space in gun db

Gun seems great - both useful and usable! However, I'm struggling to understand the difference between a public space put, a user space put and a frozen space put. My attempts at the simplest possible examples are: Public Space let gun = Gun()…
Lee
  • 29,398
  • 28
  • 117
  • 170
3
votes
1 answer

Canonical method/example to use Gun with Redux for React

I am using redux for state management for a dynamic grid where someone can add their own components. I'm using this library for the grid https://github.com/STRML/react-grid-layout . I want to use Gun as a persistence layer for storing & replicating…
demorphica
  • 123
  • 1
  • 8
3
votes
1 answer

How to use a key/value object in react

I'm struggling to make use of an object in react, I'm trying to access the key:value that is being returned (and I can successfully console.log). All the examples I've tried result in either mapping each character or throwing an object child error…
jhizzle207
  • 65
  • 5
3
votes
1 answer

How can I implement a lossless CRDT using Gun?

How do I create a CRDT using Gun? For instance, if I want to implement an grow-only array, where each element points to the next, how do I solve conflicts? To simplify, let's create this scenario, where Alice and Bob are cooperating. The array…
pgte
  • 51
  • 4
3
votes
1 answer

How far does the Offline-first feature of gunJS go ?

I would like to know how the data is persisted(saved) on the device, does it survive a reboot ? or a restart of the browser ?
Xsmael
  • 3,624
  • 7
  • 44
  • 60
3
votes
0 answers

Tutorial/example on setting up authentication for users and groups

As of today I've fired up the GunDB example setup and must say I am impressed! User authentication However, in order to fully use it for my app I would really like to have an example on how to setup user authentication with certificates. It would be…
Stefan Leever
  • 672
  • 5
  • 10
3
votes
0 answers

How are changes validated in gun?

In the wiki of the gun repo on github, there is a section about "Security, Authentication, Authorization" (Wiki Page). It describes the problem of how to avoid someone making invalid changes to the data like spamming the database or erasing the…
Tim de Putter
  • 281
  • 1
  • 2
  • 10
3
votes
2 answers

How to unsubscribe gundb on event function?

How do I stop events triggered by gun('something').on() for gundb a handler (to unsubscribe) so it would stop update the list or changes to the list.
Lightnet
  • 61
  • 1
  • 6
1
2
3
9 10