New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "update collection by ids" #77

Closed
jestan opened this Issue May 7, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@jestan

jestan commented May 7, 2014

It would be nice to have update-by-ids function also in monger.collection.
(MongoDB Java driver has com.mongodb.DBCollection#updateMulti)

(defn ^WriteResult update-by-ids
  "Update a document with given ids"
  [^String collection ids ^Map document]
  (.updateMulti (.getCollection monger.core/*mongodb-database* (name collection))
    (to-db-object {"_id" {"$in" ids}})
    (to-db-object document)))
@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin May 9, 2014

Owner

@jestan please add some tests and submit a PR. No need to update monger.multi as 2.0 will require a DB as an explicit argument. Thank you!

Owner

michaelklishin commented May 9, 2014

@jestan please add some tests and submit a PR. No need to update monger.multi as 2.0 will require a DB as an explicit argument. Thank you!

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin May 11, 2014

Owner

Actually, it would be good to add this after #76 lands.

Owner

michaelklishin commented May 11, 2014

Actually, it would be good to add this after #76 lands.

@Skinney

This comment has been minimized.

Show comment
Hide comment
@Skinney

Skinney Aug 22, 2014

Contributor

Is this under development, or something I could take a stab at?

Contributor

Skinney commented Aug 22, 2014

Is this under development, or something I could take a stab at?

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin Aug 22, 2014

Owner

@Skinney feel free to contribute it!

Owner

michaelklishin commented Aug 22, 2014

@Skinney feel free to contribute it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment