    ] with-connection ; inline
 
 : open-connection ( mdb-connection node -- mdb-connection )
-   [ >>node ] [ address>> ] bi
-   [ >>remote ] keep binary <client>
-   [ >>handle ] dip >>local 4096 <byte-vector> >>buffer ;
+    [ >>node ] [ address>> ] bi
+    [ >>remote ] keep binary <client>
+    [ >>handle ] dip >>local 4096 <byte-vector> >>buffer ;
 
 : get-ismaster ( -- result )
     "admin.$cmd" H{ { "ismaster" 1 } } send-query-1result ; 

        mdb node1 remote>>
        [ [ check-node ] keep ]
        [ drop f ] if*  :> node2

        node1 [ acc push ] when*
        node2 [ acc push ] when*
        mdb acc nodelist>table >>nodes drop 
    ] with-destructors ; 
              
: mdb-open ( mdb -- mdb-connection )
    clone [ <mdb-connection> ] keep
    master-node open-connection
    [ authenticate-connection ] keep ; 

: mdb-close ( mdb-connection -- )
     [ dispose f ] change-handle drop ;

M: mdb-connection dispose
     mdb-close ;

USING: accessors arrays assocs byte-vectors checksums
checksums.md5 constructors continuations destructors fry
hashtables io.encodings.binary io.encodings.string
io.encodings.utf8 io.sockets io.streams.duplex kernel locals
math math.parser mongodb.cmd mongodb.msg mongodb.operations
namespaces sequences splitting ;
IN: mongodb.connection

: md5-checksum ( string -- digest )
