Mark Fletcher
unread,Dec 15, 2009, 5:46:51 PM12/15/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
Hi,
I have a large collection of documents, X. I have a bunch of users who
have specified which documents in X they are not interested in.
Generally this number of documents each user is not interested in is
much smaller than the total in X. The list of documents the users are
not interested in is stored in collection Y.
I want to return the N most recent documents a given user is
interested in. Is the best way to do this to use the $nin operator?
I'd grab a chunk of documents from X, and then check to see which ones
to ignore using a $nin query on Y? And then grabbing more documents
from X and repeating until I can return N documents? Assume every
document has an integer _id, fwiw.
Hope this makes sense.
Thanks,
Mark