monger.multi.collection documentation
Includes versions of key monger.collection functions that always take a database
as explicit argument instead of relying on monger.core/*mongodb-database*.
Use these functions when you need to work with multiple databases or manage database
and connection lifecycle explicitly.
any?
(any? db collection)
(any? db collection conditions)
Like monger.collection/any? but always takes a database as explicit argument
count
(count db collection)
(count db collection conditions)
Like monger.collection/count but always takes a database as explicit argument
create
(create db collection options)
Like monger.collection/create but always takes a database as explicit argument
create-index
(create-index db collection keys)
(create-index db collection keys options)
Like monger.collection/create-index but always takes a database as explicit argument
distinct
(distinct db collection key)
(distinct db collection key query)
Like monger.collection/distinct but always takes a database as explicit argument
drop
(drop db collection)
Like monger.collection/drop but always takes a database as explicit argument
drop-index
(drop-index db collection idx-name)
Like monger.collection/drop-index but always takes a database as explicit argument
drop-indexes
(drop-indexes db collection)
Like monger.collection/drop-indexes but always takes a database as explicit argument
empty?
(empty? db collection)
Like monger.collection/empty? but always takes a database as explicit argument
ensure-index
(ensure-index db collection keys)
(ensure-index db collection keys options)
(ensure-index db collection keys name unique?)
Like monger.collection/ensure-index but always takes a database as explicit argument
exists?
(exists? db collection)
Like monger.collection/exists? but always takes a database as explicit argument
find
(find db collection)
(find db collection ref)
(find db collection ref fields)
Like monger.collection/find but always takes a database as explicit argument
find-and-modify
(find-and-modify db collection conditions document & {:keys [fields sort remove return-new upsert keywordize], :or {fields nil, sort nil, remove false, return-new false, upsert false, keywordize true}})
Like monger.collection/find-and-modify but always takes a database as explicit argument
find-by-id
(find-by-id db collection id)
(find-by-id db collection id fields)
Like monger.collection/find-by-id but always takes a database as explicit argument
find-map-by-id
(find-map-by-id db collection id)
(find-map-by-id db collection id fields)
(find-map-by-id db collection id fields keywordize)
Like monger.collection/find-map-by-id but always takes a database as explicit argument
find-maps
(find-maps db collection)
(find-maps db collection ref)
(find-maps db collection ref fields)
Like monger.collection/find-maps but always takes a database as explicit argument
find-one
(find-one db collection ref)
(find-one db collection ref fields)
Like monger.collection/find-one but always takes a database as explicit argument
find-one-as-map
(find-one-as-map db collection ref)
(find-one-as-map db collection ref fields)
(find-one-as-map db collection ref fields keywordize)
Like monger.collection/find-one-as-map but always takes a database as explicit argument
find-seq
(find-seq db collection)
(find-seq db collection ref)
(find-seq db collection ref fields)
Like monger.collection/find-seq but always takes a database as explicit argument
indexes-on
(indexes-on db collection)
Like monger.collection/indexes-on but always takes a database as explicit argument
insert
(insert db collection document)
(insert db collection document concern)
Like monger.collection/insert but always takes a database as explicit argument
insert-and-return
(insert-and-return db collection document)
(insert-and-return db collection document concern)
Like monger.collection/insert-and-return but always takes a database as explicit argument
insert-batch
(insert-batch db collection documents)
(insert-batch db collection documents concern)
Like monger.collection/insert-batch but always takes a database as explicit argument
map-reduce
(map-reduce db collection js-mapper js-reducer output query)
(map-reduce db collection js-mapper js-reducer output output-type query)
Like monger.collection/map-reduce but always takes a database as explicit argument
remove
(remove db collection)
(remove db collection conditions)
Like monger.collection/remove but always takes a database as explicit argument
remove-by-id
(remove-by-id db collection id)
Like monger.collection/remove-by-id but always takes a database as explicit argument
rename
(rename db from to)
(rename db from to drop-target)
Like monger.collection/rename but always takes a database as explicit argument
save
(save db collection document)
(save db collection document write-concern)
Like monger.collection/save but always takes a database as explicit argument
save-and-return
(save-and-return db collection document)
(save-and-return db collection document write-concern)
Like monger.collection/save-and-return but always takes a database as explicit argument
update
(update db collection conditions document & {:keys [upsert multi write-concern], :or {upsert false, multi false, write-concern monger.core/*mongodb-write-concern*}})
Like monger.collection/update but always takes a database as explicit argument
update-by-id
(update-by-id db collection id document & {:keys [upsert write-concern], :or {upsert false, write-concern monger.core/*mongodb-write-concern*}})
Like monger.collection/update-by-id but always takes a database as explicit argument
upsert
(upsert db collection conditions document & {:keys [multi write-concern], :or {multi false, write-concern monger.core/*mongodb-write-concern*}})
Like monger.collection/upsert but always takes a database as explicit argument