    ] 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 ; 

USING: accessors arrays assocs byte-vectors checksums
checksums.md5 constructors 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 namespaces sequences
splitting ;
IN: mongodb.connection

: md5-checksum ( string -- digest )


: check-node ( mdb node --  )
   [ <mdb-connection> &dispose ] dip
   [ [ open-connection ] [ 3drop f ] recover ] keep swap
   [ [ get-ismaster eval-ismaster-result ] with-connection ] [ drop ] if* ;

: nodelist>table ( seq -- assoc )
   [ [ master?>> ] keep 2array ] map >hashtable ;
