Update doesn't keep key

16 views
Skip to first unread message

Flavio Oliveira

unread,
May 28, 2014, 3:37:15 AM5/28/14
to clojure...@googlegroups.com
Hi,

I am trying to update a document (com.novemberain/monger "2.0.0-rc1")

Original document
{
    "_id" : ObjectId("538590c9fa3994a54c5bc4f0"),
    "round" : 3,
    "score" : 1
}

(mc/update table "teste" {:round 3} {:score 10} {:multi false})))

Updated
{
    "_id" : ObjectId("538590c9fa3994a54c5bc4f0"),
    "score" : NumberLong(10)
}

soce has been updated but ... What happened to the round field?

Regards, Flavio


Michael Klishin

unread,
May 28, 2014, 3:40:59 AM5/28/14
to Monger, a Clojure MongoDB driver
2014-05-28 11:37 GMT+04:00 Flavio Oliveira <flav...@gmail.com>:
(mc/update table "teste" {:round 3} {:score 10} {:multi false})))

Updated
{
    "_id" : ObjectId("538590c9fa3994a54c5bc4f0"),
    "score" : NumberLong(10)
}

soce has been updated but ... What happened to the round field?

Samuel Lê

unread,
Jul 29, 2014, 7:01:58 PM7/29/14
to clojure...@googlegroups.com
Hi,

I had the same issue as Flavio. I am wondering, for the function update, shouldn't {$set {:key value}} be the default?

Cheers,
Sam

Michael Klishin

unread,
Jul 29, 2014, 11:17:16 PM7/29/14
to clojure...@googlegroups.com, Samuel Lê
 On 30 July 2014 at 07:15:58, Samuel Lê (samu...@gmail.com) wrote:
> > I had the same issue as Flavio. I am wondering, for the function
> update, shouldn't {$set {:key value}} be the default?

This would make Monger's defaults incompatible with the rest of the MongoDB
drivers and MongoDB shell.
--
@michaelklishin, github.com/michaelklishin
Reply all
Reply to author
Forward
0 new messages