$addToSet and $slice

117 views
Skip to first unread message

alexmnyc

unread,
Sep 4, 2013, 11:30:46 AM9/4/13
to rogue...@googlegroups.com
Is there a way to use $addToSet with $slice modifier in rogue?

Thank you.

Example:

db.students.update( { _id: 2 },
$addToSet: { grades: {
   $each: [ 80, 78, 86 ],
   $slice: -5
   }
 }
}
)

Jason Liszka

unread,
Sep 4, 2013, 11:33:24 AM9/4/13
to rogue...@googlegroups.com
Is that supported by mongodb? I couldn't find it in the docs.


--
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.

alexmnyc

unread,
Sep 4, 2013, 2:23:14 PM9/4/13
to rogue...@googlegroups.com
It looks like it is in 2.4 release according to these unless I'm misreading something:

Jason Liszka

unread,
Sep 4, 2013, 3:00:09 PM9/4/13
to rogue...@googlegroups.com
Looks like it was closed "Won't Fix"


On Wed, Sep 4, 2013 at 2:23 PM, alexmnyc <a.mik...@gmail.com> wrote:
It looks like it is in 2.4 release according to these unless I'm misreading something:

--

a.mik...@gmail.com

unread,
Sep 4, 2013, 3:33:45 PM9/4/13
to rogue...@googlegroups.com
Indeed. Upon thorough inspection, it looks like $each is the only modifier supported with $addToSet. My bad, sorry for not reading into it closer.
You received this message because you are subscribed to a topic in the Google Groups "rogue-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rogue-users/hO7Z8xzsm_A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rogue-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages