     [{:keys [_type _id fields]}]
     {:id _id
      :type (estype->type _type)
+     :allow (:allow_token_document fields)
+     :deny (:deny_token_document fields)
      :mtime (-> fields :lastmodified lastmodified->mtime)}))
 
 (defn enrich-es-entries

  [existing-map entries]
  (remove #(contains? existing-map (:id %)) entries))

(defn entry-needs-update?
  "compare es-entry with mq-entry and determine if we need to update it"
  [es-entry mq-entry]
  (not= (:mtime es-entry) (:mtime mq-entry)))

(defn find-updates
  "compare entries with those in es-file-map and return a seq of

              ["dir" "doc"]
              :size 1000000
              :query {:match_all {}}
              :fields ["parent" "lastmodified" "allow_token_document" "deny_token_document"]
              :filter {:term {:parent parent}}))


