Add explicit GridFS instance parameter to monger.gridfs/remove, /remove-all and /all-files
Unfortunately, we cannot do the same for functions that implement GridFS-related protocols.
This commit is contained in:
parent
0bfe0582c0
commit
8f6c5cdf2a
1 changed files with 11 additions and 5 deletions
|
|
@ -3,7 +3,7 @@
|
|||
(:require [monger.core]
|
||||
[clojure.java.io :as io])
|
||||
(:use [monger.conversion])
|
||||
(:import [com.mongodb DBObject]
|
||||
(:import [com.mongodb DB DBObject]
|
||||
[com.mongodb.gridfs GridFS GridFSInputFile]
|
||||
[java.io InputStream File]))
|
||||
|
||||
|
|
@ -30,17 +30,23 @@
|
|||
([]
|
||||
(remove {}))
|
||||
([query]
|
||||
(.remove ^GridFS monger.core/*mongodb-gridfs* ^DBObject (to-db-object query))))
|
||||
(.remove ^GridFS monger.core/*mongodb-gridfs* ^DBObject (to-db-object query)))
|
||||
([^GridFS fs query]
|
||||
(.remove fs ^DBObject (to-db-object query))))
|
||||
|
||||
(defn remove-all
|
||||
[]
|
||||
([]
|
||||
(remove {}))
|
||||
([^GridFS fs]
|
||||
(remove fs {})))
|
||||
|
||||
(defn all-files
|
||||
([]
|
||||
(.getFileList ^GridFS monger.core/*mongodb-gridfs*))
|
||||
([query]
|
||||
(.getFileList ^GridFS monger.core/*mongodb-gridfs* query)))
|
||||
(.getFileList ^GridFS monger.core/*mongodb-gridfs* query))
|
||||
([^GridFS fs query]
|
||||
(.getFileList fs query)))
|
||||
|
||||
|
||||
(defprotocol GridFSInputFileFactory
|
||||
|
|
|
|||
Loading…
Reference in a new issue