I'm facing a similar issue. Did you manage to solve the problem?
On Friday, May 1, 2015 at 2:05:11 AM UTC-4, henrique matias wrote:
One way i thought of, is to push the user id to a "viewed_by" property, so
then instead of doing 2 queries one to find the viewed articles and another
one to find unread articles, i'll just do 1 query looking forward articles
where the "id" of the user isn't contained in the document's 'viewed_by'
The problem then is that this "viewed_by" property, will become bigger and
bigger and it might become slow as well at some point ?
Is there such thing as storing the values in a "sorted" way, so then when
using executing $ne it won't need to lookup all the values of the viewed_by
array ( using binary search or some other fast way ) ?
any advice is highly appreciated,
I'm currently having an issue with a system i'm designing, basically i
need to filter my query with a $nin, but the $nin for each user grows
everyday and it won't stop growing.
So basically sooner or later this queries will start to smell and leak..
Is there any "well known pattern" to filter out results from a query?
As an example: 500k users do some "advanced search" every day, but they
can never see the same article.
Articles are constantly being added and new users and constantly
My current solution is to store the _ids in an Array owned by the user
document, but with this design things gonna blow when users start to query
with thousands os values on $nin..