           old-data (get-doc dbname uuid)
           final (merge old-data data)]
       (do (spit fname final)
+          (write-index-keys! dbname final)
           final))
     (let [uuid (uuid)
           fname (id-path dbname uuid)
           final (assoc data :uuid uuid)]
       (do (spit fname final)
           (add-uuid! dbname uuid)
+          (write-index-keys! dbname final)
           final))))
 
 (defn put-docs!

              [])
        {:status true :message (str dbname " has been created")})))

(defn get-doc
  "Get one doc from dbname, with two arguments it returns the doc in
  dbname with a specified uuid , with three arguments it returns the

       (let [res-doc (try (read-string (slurp fname))
                          (catch Exception e))]
         res-doc)))
  ([dbname kv option]
     (first (get-docs dbname kv option))))

(defn get-docs
  "With one argument it returns all docs in dbname, with two arguments
