Artem, I just added my vote, but perhaps it's also a good idea to push this ticket info (with short summary onto the mailinglist?) to get attention to it. Also my proposal differs somehow from the initial post and it might be kinda misleading to what is beeing voted for.
I personally don't agree with shift/unshift in total, for me it takes more understanding, from a stack/array logic point of view, to understand those and I see those in a broader concept: (not onlty top/bottom)
Idea for me:
"$shift" -> shifts any item in question by the stack by (possible negative value for updwards) X positions from current position, either finding it by direct addressing it as 'Item2', or by positional index - if the position is out of reach, the item just drops to the end of the list.
But this way of course assumes, that you exactly know the position of the element to be moved, and this can of course change if the current information is outdated and there are no reference counters (probably a bad idea, I dunno).
On the other hand, if one wants a dynamic increasing stack (forwards and backwards) - shifting with "null" value inserts could also be desired, but perhaps sometimes not of course..
Thats why I came up with the examples
$pushAt, $popFrom, $pullOnce - cause one can
in heavy updated documents:
$pushAt" -> Pushes at exact positon, $pullOnce - removes one existing, but unique, value from the stack/array
But of course, keeping track of an object position - for example by referencing a index position is kinda risky - assuming anohter element gets pushed at the same position - but we don't track the previous item has moved one forward (down) in the array. But this might also depend on the use case and $pullOnce may come into play.
in single documents not affected by massive changes:
"$popFrom" -> If we we are safe with a document, we tell mongo exactly which position to be removed,
of course also the "$pullOnce" solution can be used, but this involves scanning data - which might be not neccesary - but I agree that this command is quite special as most of the time one not might know beforehand the actual positon of one item so.
Anyhow, sorry for this long post so, but I hope it makes sense.