►
From YouTube: hyper connect workshop with Tom Wilson
Description
This workshop is part 2 in a series of intro-level workshops to the hyper service. In this workshop, we will discuss hyper connect and add some core features to our Mario Wiki API. Update, Remove and List
You can follow along with the GitHub repo:
https://github.com/hyper63/workshops
A
Hello
welcome
to
the
hyper
connect
workshop
in
this
workshop.
It's
part
two
of
a
series
of
hyper
workshops,
teaching
you
how
to
use
the
hyper
data
service,
and
in
this
workshop
we
will
start
to
talk
about
hyper
connect.
A
A
We
modeled
it
based
on
a
url,
so
we
could
leverage
the
url
parse
library
in
both
node
and
dino,
and
when
it
parses
the
connection
string
hyperconnect,
when
hyperconnect
parses
the
connection
string,
it
will
grab
the
protocol
to
determine
if
it's
a
local
or
on-prem
hyper
service
or
in
the
cloud,
our
cloud
hyper
service
and
then
a
key
and
a
secret.
It
uses
the
secret
to
sign
a
json
web
token
and
the
key
goes
into
the
the
token
as
a
sub
claim.
A
For
more
information
of
specifically
http
clients
in
javascript,
I'd
recommend
you
check
out
the
developer
mozilla
site,
where
you
can
see
the
request
object
because
basically,
hyperconnect
just
creates
these
request
objects,
and
then
you
can
use
any
http
client
to
send
if
you're
on
node
and
if
you're
on
dino,
the
fetch
client
is
built
into
the
platform
so
we'll
be
using
dino.
Today,
there's
an
also
a
identical
workshop
on
node
coming
out,
but
for
now
we'll
use
dino
and
essentially,
when
I
call
in
my
application,
hyper.data.update
passing
some
arguments.
A
A
And
then
the
identifier
which
is
coming
from
one
of
the
arguments
and
then
the
host
again
is
coming
from
the
hyper
connect
string.
A
It
is
a
json
api,
so
we
have
to
say,
content
type
is
json
and
then
the
token
is
the
json
web
token
that's
created
by
using
the
key
in
secret
and
then
the
body
that
we
want
to
send
to
the
service
for
more
information
about
the
entire
hyper
connect
api.
You
can
go
to
our
documentation,
page
slash
cloud,
slash,
hyper
connect
all
right!
So
now,
let's
work
on
the
workshop
and
before
we
get
started,
we
just
have
to
set
up
our
environment
if
you've
loaded
it
in
get
pod,
you're
really
close
to
completion.
A
A
A
Okay,
now
we've
got
our
app.
If
we
open
that
in
our
app
panel
we
can
copy
this
connection
string
by
hitting
this
little
document
icon
here
and
you'll
notice.
It's
copied,
then
we
can
go
into
our
get
pod
environment
and
we
cd
into
connect
and
let's
create
a
emv
file
and,
let's
add
hyper
equals
in
our.
A
Our
connection
string
that
we
copied
from
the
dashboard
and
let's
add
that
to
the
emv
file,
so
I
just
did
echo
and
that
should
have
created
a
dot
emv
file.
So
if
I
type
that
you
can
see
that
I've
got
hyper
and
my
connection
string
in
there,
so
that's
great
and
then
the
next
couple
of
steps
one
is
we're
going
to
do
a
setup
script,
we'll
run
that
and
that's
just
going
to
add
some
documents
in
our
hyper
service
to
play
with
and
then
the
other
will
be
a
start
script
to
start
our
api
server.
A
And
we're
going
to
use
a
rest
tool
called
hopscotch
I'll,
just
clear
out
my
previous
entries.
Yes
in
that
url
and
refresh
to
a
clean
slate,
so
hopscotch
is
just
a
way
to
write
a
fancy
curl
or
a
fancy
request
in
the
browser.
So
it's
it's
nice
it'll
be
easy
on
the
eyes
and
give
us
a
way
to
you
know
see
what's
going
on
with
our
api
service,
so
the
first
thing
we'll
do
is
we'll
make
sure
our
web
server
is
running.
A
So
we've
got
mario
wiki
api,
that's
good!
Let's
go
ahead
and
just
copy
that
put
that
in
our
hopscotch
url
and
do
a
get
and
we
got
mario
wiki
api
all
right.
So,
let's
get
to
our
workshop.
The
first
thing
we
want
to
do
is
update
character
and
to
update
a
character
in
our
previous
workshop.
You
learned
how
to
add
a
document
and
get
a
document
by
id.
A
A
A
Oh
api,
api
characters,
character,
slash
one
should
return
the
first
character,
mario
in
our
mario
wiki,
and
then
what
we're
going
to
do
is
change
it
by
adding
a
description.
Mario
is
a
plumber
and
we'll
change
this
get
to
a
put,
and
we
send
that
and
ok
true,
we
updated
our
character,
pretty
awesome.
A
A
And
then
params.id,
so
we
need
the
param
and
then
we're
just
going
to
send
the
result
to
the
caller.
Okay.
So
with
that
command,
we
can
go
over
to
our
hot
scotch
tab
and
we
have
characters
character
id.
If
we
change
our
verb
to
a
delete,
then
we
should
effectively
remove
that
character
from
the
database.
We
can
double
check
that
with
this
get
command
and
send-
and
you
can
see-
ok,
false
means
that
it
could
not
find
it
okay.
A
So
that's
good!
It
can't
find
the
the
character,
let's
go
ahead
and
re-add
it
for
our
third
part
of
the
workshop,
and
that
is
the
list
item.
So
this
is
a
range
query
list,
which
means
you
can
add
certain
attributes
to
the
list
command
to
either
query
by
range
or
a
set
of
keys,
etc.
A
And
what
we'll
do
is
we'll
go
through
kind
of
some
of
the
types
of
lists
you
can
do
you
can
list
with
a
default
limit?
You
can
list
with
a
specified
limit
and
you
can
list
using
a
range
of
start
key
and
end
key
and
list
with
specific
keys.
So
let's
go
ahead
and
build
the
easiest
list
function
so
we'll
go
to
our
list,
characters
and
we'll
import
hyper
from
hyper
connect
and
then
we'll
say,
result
equals
away
hyper.data.list,
open
friend,
close
paren
and
then
we'll
just
send
the
result
to
the
client.
A
A
A
Okay.
Here
we
just
return
two
docs
pretty
cool.
Now
we
can
also
do
a
range,
so
we
can
do
start
key
and
the
range
is
alphanumeric,
so
we
can
say
like
a
and
then
it
would
be
like
all
the
identifiers
that
start
with
a
and
then,
if
there's
no
stop
key,
then
it
would
continue
to
list.
If
we
said
you
know
start
key
b,
then
it
would
be
all
the
identifiers
that
start
with
d
and
so
on
down
the
list.
A
So
let's
do
character,
2
and
then,
let's
add
an
n
key
to
make
a
range
and
let's
do
character
three
right,
so
the
scar
start
key
will
be
two.
The
end
key
will
be
three,
and
if
we
run
that
we
should
get
characters
two
and
three,
not
one
and
two,
and
we
do
characters
two
and
three
pretty
cool,
but
the
key
to
the
range
is
is
alphanumeric.
A
So,
whatever
your
start
key
needs
to
exist
in
an
identifier
list.
That's
different
from
your
end
key
and.
A
A
So
there's
a
lot
more
that
you
can
do
with
the
list
object.
You
know
really
welcome
you
to
to
check
out
the
docs
here.
We're
gonna
do
one
more
we're
going
to
show
how
composable
these
commands
are
by
just
getting
the
array
and
then
filtering
the
array
by
type
so
making
this
create
this
pure
function.
A
A
A
Okay,
so
to
summarize,
we
talked
about
hyper
connect
and
we
talked
about
the
update,
the
remove
and
the
list
in
the
next
workshop.
We'll
do
the
query
feature
and
the
bolt
feature.
The
query
feature
allows
you
to
provide
a
you
know:
javascript
object
using
selectors
to
create
a
more
advanced
query
when
you
query
your
data
and
then
the
bulk
feature
allows
you
to
combine
multiple
documents
in
an
array
and
submit
one
request
or
a
bulk,
and
it
can
insert
update
our
removed
documents
in
that
one
request.