►
From YouTube: hyper63 hacking 2/11
Description
Part 4 of adding the bulk api endpoint for the data port
https://github.com/hyper63/hyper63
A
Okay,
we're
gonna
go
ahead
and
get
started.
People
may
join,
but
basically
we're
gonna
try
to
knock
this
issue
out
we're
starting
a
little
early
today
and
just
because
things
will
start
to
get
crazy
at
five
o'clock.
A
My
house
and
I
may
change
these
up
next
week
to
do
them
monday
through
thursday,
from
9
to
10,
because
that
is
really
when
it's
the
most
quiet
here
and
I
think
we'll
get
better
results
out
of
that.
So
so
we're
we're
nearing
the
completion
of
this
new
enhancement
for
the
bulk
endpoint
for
the
data
api
and
what
we
want
to
do
is
just
deal
with
some
particular
kind
of
edge.
A
Cases
with
you
know,
handling
the
input,
basically
making
it
safer
and
more
predictable,
so
we
need
to
kind
of
handle
if.
B
A
In
empty
list
of
documents,
basically,
if
there's
no
documents,
there's
no
bulk
ad,
but
you
know,
maybe
someone
might
try
to
pass
that
handle
a
list
of
non
objects
like
instead
of
objects.
Someone
passes
one
two,
three
four,
which
can't
really
do
much
with
that
and
then
handle
a
list
of
objects
without
an
id
in
this
past
like
hello
world
or
something
like
that.
A
So
those
are
the
cases
we
want
to
just
handle
in
our
implementation
and,
let's
see,
we've
got
our
pull
request,
it's
processed.
So
what
we
want
to
do
is
start
on
this
and
pull
down
main
and
then
check
out
a
new
feature
branch
and
really
manage
these
error
cases.
So,
let's
pop
over
here
and
get
in
the
project
and
I'm
probably
going
to
break
out
that
function,
because
yesterday
I
was
like
moving
up
and
down
the
files
and
I'm
going
to
break
out
the
function
into
a
separate
file.
So
we
don't
have
to.
A
A
Main
pool
origin
name
make
sure.
Okay,
we
got
all
of
our
new
pouch
stuff,
so
we're
gonna
get
check
out
a
new
branch
and
we'll
just
call
this.
A
Cool
and,
like
I
said,
we'll,
probably
just
break
this
function
out,
maybe
put
it
in
a
lib
folder.
So
we'll
just
make
a
directory
lib
and
just
call
this
vault.js
and
go
into
adapter.js
and
we'll
just
import.
B
A
A
B
B
A
A
B
A
And
now
we're
just
going
to,
let's
just
make
sure
we
know
we
need
a
search,
we
know
we
need
compose,
we
know
we
need
find.
A
A
Okay,
so
now
that
we
have
this
as
a
separate
file,
we'll
want
to
create
a
separate
test.
Just
do.
B
B
B
B
B
B
B
B
B
B
B
A
Now
we
could
default
it
to
a
string,
so
we
could
go
in.
A
B
A
B
B
B
B
B
A
A
B
A
A
B
B
A
A
Okay,
so
let's
see
we
still
are
doing
that.
So,
let's,
let's
see
what
our
db
is
coming
in
at.
A
A
B
A
B
A
B
B
A
B
B
A
B
B
A
B
B
B
A
A
So
we'll
be
moving
these
next
weeks
to
the
morning,
because
that's
just
crazy
kids
are
crazy
and
they're
having
fun.
But
okay,
so
we
created
a
database
and
what
we
want
to
do
in
this
case
is
pass
an
empty
list
of
documents.
So,
instead
of
all
these
guys,
we're
just
going
to
pass
an
empty
list
and
we'll
use
db
name,
and
we
don't
need
to
create
a
document
for
this
test
case.
A
A
A
B
A
Let's
see
what
this
does:
okay,
at
least
it
blows
up.
It's
good,
okay,
deep,
equal,
it's
an
empty
array.
So
basically
it
came
back
with
an
empty
array.
Just
probably
pretty
good.
There's
probably
no
need
to
check
that.
So,
let's
well
yeah
inspected
one
two,
three,
an
actual
it's
an
empty
array
see
I
don't
know
if
that's.
B
B
A
So
it
added
the
documents
and
generated
ids
kind
of
interesting.
B
B
B
A
A
B
A
B
A
B
A
A
So
we
could
check
the
first
one
and
see
if
the
first
one
is
an
object.
So
we've
got
like
this
is
check
and
see
if
it's
an
object
and
if
it's
not
an
object,
we
we
throw
it,
throw
it
back.
So
that's
probably
what
we'll
do
here
and
that'll
take
care
of
both
of
those
as
we
want
to
move
over
to
couchdb
and
see
if
we
can
get
that
knocked
out
as
well.
A
A
A
B
B
A
B
A
A
Okay,
that's
good,
but
the
empty
array.
It's
not
happy!
A
A
Patch
anything
we
need
to
add,
we
need
to
add
bulk
in
there.
A
B
A
So
we
added
our
bulk
in
there
tester
passing,
get
commit
added,
more
test
for
error
cases
and
we'll
push
that
up
to
add
bulk
watch
db.
A
Okay,
while
that
test
is
running,
what
we're
going
to
do
now
is
switch
over
to
couchdb,
so
I'm
going
to
just
go
ahead
and
check
out.
B
A
Okay,
so
we've
got
the
same
pattern:
let's
just
go
ahead
and
make
a
directory
web
and
default.js
to
that
and
let's
make
sure
all
our
tests
pass.
A
B
A
A
Cool,
so
all
our
tests
are
running,
we've
got
our
bulk
js
file
in
there
and
let's
look
at
our
adapter
js.
A
A
A
And
we'll
just
say,
oh
for
right
now,
so
when
the
dbs
pass.
So
since
this
is
couchdb,
we'll
have
this
config
origin
that'll
be
kind
of
our
database
route
and
then
we'll
have
the
db
name
and
then
our
command-
and
this
is
all
using
fetch,
so
that'll
be
fun.
A
A
That'll
give
us
what
we
need.
Let's
write
our.
B
B
B
B
A
A
A
B
B
B
A
So
we
basically
need
to
you
know
kind
of
grab
the
ids
get
the
docs
that
exist,
merge
with
rev
switch.
So
a
lot
of
this
stuff
we
need
to
duplicate,
but
instead
of
using
like
the
pouchdb
api,
we're
going
to
use
the
fetch
api
to
do
that.
B
A
B
B
B
B
A
Cool,
so
we
plug
the
ids.
Let's
open
up
our.
A
B
A
A
Exist
and
what
it's
doing
is
we
want
to
do
in
a
sync
fetch
right,
so
we'll
need
the
url
and
the
headers
url
and
headers.
A
Where
keys
equals
and
we
want
to
give
it
a
url
encoded.
A
A
A
A
A
Sync
from
promise
and
then
we'll
take
fetch
and
fetch
is
kind
of
global,
so
it's
just
provided
for
us
through
our.
It
should
be
we'll
find
out,
but
that's
how
it
should
be
and
then
to
json
get
a
response
object
and
then
we
want
to
convert
that
into
a
sync
and
a
sync
from
a
promise,
so
the
json
function
we'll
bind
that
to
rest.
So
we
get
the
right
instance
and
then
we'll
execute
that
that
should
be
our
2
json.
A
A
B
A
So
what
we
want
to
do
is
take
this
fetch
and
assign
it
globally
so
that
it
will
use
this
sandbox
feature
so
really.
A
B
A
So
if
we
call
all
docs,
we
get
rows
and
we
get
the
value
and
it's
actually,
I
think.
A
Okay,
so
we
hadn't
called
it
yet.
So
let's
go
ahead
and
call
it
so
we
plug
the
ids
and
then
we
chain,
because
it's
gonna
return
on
a
sync
get
docs.
A
Cool,
so
there's
not
a
match
for
the
couchdb,
all
docks
get
keys.
One
and
two,
I
think
I
need
to,
I
think,
that's
all
right.
A
B
B
A
A
B
A
Right
so
we've
got
our
array
coming
back
and
we'll
just
do
the
x,
revs
and
kind
of
call
it
a
day
because
we're
right
at
the
one
hour
point
so
we'll
do
our
x,
reps
function
and.
A
A
rev
id
and
rev
array
right,
I
think,
that's
correct,
so
we're
gonna,
compose
and
omit.
A
Okay,
so
now
it's
gonna
be
asking
me
for
all
this
stuff.
A
A
And
there
we
go
so
we
got
our
id
and
what
rub
very
cool,
so
we're
making
progress.
I'm
going
to
go
ahead
and
close
this
out
and
work
on
implementing
the
rest
of
the
stuff
and
then
we'll
start
something
new
on
monday,
and
we
will
probably
stream
monday
morning
thanks
for
joining
and
have
a
great
day.