       )))
 
 (defn random-json-features [out-stream dataset collection total & args]
-  (let [{:keys [:updates? :nested] :or {:updates? false :nested 0}} args
+  (let [{:keys [updates? nested] :or {updates? false nested 0}} args
         validity (tf/unparse date-time-formatter (local-now))
         attributes (create-attributes 3 nested)
         gens (transient [])
-        gens (conj! gens (fn [id] ( random-new-feature collection id validity attributes)))
+        gens (conj! gens (fn [id] (apply random-new-feature collection id validity attributes args)))
         gens (if updates? (conj! gens (fn [id] (random-change-feature collection id validity attributes))) gens)
         generator (apply juxt (persistent! gens))
         gen-fn #(generator (random-word 10))

  (doseq [c [3 33 333 3333 33333]]
    (with-open [w (clojure.java.io/writer (str ".test-files/new-features-nested-features-" c ".json"))]
      (random-json-features w "updateset" "collection1" c :nested 2))))

(def attribute-generators [#(random-word 5) random-date random-moment])

(defn random-new-feature
  ([collection id validity attributes & {:keys [geometry?] :or {geometry? true}}]
   (let [feature (transient {:_action "new"
                          :_collection collection
                          :_id id
                          :_validity validity})
         feature (if geometry? (assoc! feature :_geometry (random-geometry)) feature)
         random-values (map (fn [[key gen]] (vector key (gen))) attributes)
         feature (reduce (fn [acc val] ( apply assoc! acc val)) feature random-values)]

     (persistent! feature))))

(defn update-an-attribute [attributes update-fn exceptions]
  (let [valid-keys (keys (apply dissoc attributes exceptions))
