I have db mongdb example with document a and document b
a_id type 1 1 2 2 3 3 4 4
Now. I want to extract the last N (1,2,3,4,5,....) values in table b in the same order as in the example above. But if I use skip function :
if M > N then result empty => wrong. I want dynamic M. If I use sort and limit then it does not give the correct order.
4 4 3 3
I want a solution!</div