I hereby claim:
- I am micheldiz on github.
- I am micheldiz (https://keybase.io/micheldiz) on keybase.
- I have a public key ASBjU3iHeA4_FpHGHorzXcFzmx9aExSv93oxLkvXVqg4MQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // Helpers | |
| //import { camelizeKeys, decamelizeKeys, decamelize } from 'humps'; | |
| import { has } from 'lodash'; | |
| import bcrypt from 'bcryptjs'; | |
| import DgraphClient from 'dgraph-node'; | |
| // Create a new client | |
| let client = new DgraphClient({ | |
| url: 'localhost:9080', | |
| debug: false |
| async registerDgraph({ username, email, password, role, isActive }) { | |
| // const passwordHashed = await bcrypt.hash(password, 12); | |
| console.log(username, '<====== username'); | |
| const txn = dgraph.newTxn(); | |
| try { | |
| if (role === undefined) { | |
| role = 'user'; | |
| } | |
| const now = new Date().toISOString(); | |
| let mu = new dgraph.Mutation(); |
| { | |
| "set": [ { | |
| "user": [ | |
| { | |
| "uid": "_:michael", | |
| "name": "Michael", | |
| "age": 39, | |
| "Posts": [ | |
| { | |
| "uid": "_:michaelfirst", |
| { | |
| set { | |
| #We create the groups as nodes | |
| _:group_year <name> "1979" . | |
| _:group_year <release_date> "1979-01-01" . | |
| _:group_year2 <name> "1950" . | |
| _:group_year2 <release_date> "1950-01-01" . | |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "github.com/dgraph-io/dgo/v2" | |
| "github.com/dgraph-io/dgo/v2/protos/api" |
You must have already performed the following in one form or another as well as properly set a STATIC IP. Bear in mind many instructions do not properly show how to commit iptables changes on Photon which then survive reboots.
iptables -A INPUT -p tcp --dport 2375 -j ACCEPT
iptables -A INPUT -p tcp --dport 2376 -j ACCEPT
iptables-save > /etc/systemd/scripts/ip4save
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "github.com/dgraph-io/dgo/v2" | |
| "github.com/dgraph-io/dgo/v2/protos/api" |
| upsert { | |
| query { | |
| getVals(func: has(products)) { | |
| productsUid as uid | |
| products @filter(eq(productId, 19610626)) { | |
| productUid as uid | |
| options @filter(eq(optionId, 32661491)) { | |
| optionUid as uid | |
| } | |
| } |