Rogue support of new $setOnInsert operator

102 views
Skip to first unread message

Aleksey Izmailov

unread,
Sep 11, 2013, 5:23:21 PM9/11/13
to rogue...@googlegroups.com
Hi all,

Just wondering if Rogue has any plans to support $setOnInsert operator as described here:

http://docs.mongodb.org/manual/reference/operator/setOnInsert/

It seems to be pretty useful since it does things I can't do with findAndModify and upsert option of update.

Thanks

Jason Liszka

unread,
Sep 12, 2013, 12:02:16 PM9/12/13
to rogue...@googlegroups.com
That does seem useful. We didn't have any immediate plans to put it in, but I'll add it to the list.

Do you know whether this is exposed in the mongo java driver? I don't see anything obvious in the API docs...


That would be a prerequisite for adding this feature to rogue.


--
You received this message because you are subscribed to the Google Groups "rogue-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rogue-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Aleksey Izmailov

unread,
Sep 12, 2013, 1:17:18 PM9/12/13
to rogue...@googlegroups.com
Although I didn't see any mention of $setOnInsert in release notes or in the java driver code base I found these links where people use it:

http://stackoverflow.com/questions/18711960/how-to-convert-mongo-shell-query-to-java-basicdbobject

https://github.com/deftlabs/mongodb-examples/blob/master/mongo-java-setOnInsertTest/src/main/com/deftlabs/tests/mongo/SetOnInsertTest.java

It seems that java driver "does not care" as it's just a string operator (I might be wrong about it).

Thanks for adding it to the list! ;)

Jason Liszka

unread,
Sep 12, 2013, 2:25:47 PM9/12/13
to rogue...@googlegroups.com
Oh, I see, it's just a regular operator. I misread it as an extra argument to upsert(). That should be an easy fix.

Konrad Malawski

unread,
Sep 13, 2013, 10:01:09 PM9/13/13
to rogue...@googlegroups.com
Hey guys,
I've noticed that's a nice little low-hanging-fruit I could help out with. I remember also needing it at some point in the past, and as I'll be bored on the flight to SF I'll give it a shot today :-)

-- 
Cheers, Konrad
Reply all
Reply to author
Forward
0 new messages