Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4542140
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:20:48+00:00 2026-05-21T15:20:48+00:00

I have two collections: news and subscribes. Every news item has an array of

  • 0

I have two collections: news and subscribes. Every news item has an array of strings – “tags”. Every subscribe also has such “tags”.

Subscribe’s news items are items having all tags that subscribe has, and may be more. News item’s subscribes are subscribes having any of this item’s tags, but no any more.

When I want to get a Subscribe’s news, I’m doing such request on Ruby MongoID:

NewsItem.where(:tags.all => @subscribe.tags)

How can I get all subscribes for some news item?

For example:

item.tags = ["foo", "bar"]

subscribe1.tags = ["foo"]
subscribe2.tags = ["bar"]
subscribe3.tags = ["foo", "bar"]
subscribe4.tags = ["foo", "bar", "baz"]

item.subscribes should give subscribes 1..3, but subscribe4 should not be included, because it has a “baz” tag that is not included in item.tags

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:20:49+00:00Added an answer on May 21, 2026 at 3:20 pm

    Based on your description, you don’t really want an $all. Instead, you are looking for some form $subset operator. There is JIRA request for just such a thing, however it is not implemented at this time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenario. I have two collections, one has some items missing.
I have a class which has two HashSet<String> collections as private members. Other classes
I have two IEnumerable collections that I would like to union. One selects news
I have two collections, the first with an array of id's referencing documents in
I have two collections of strings: CollectionA is a StringCollection property of an object
I have two collections: List<int> ids; List<User> users; Where User has id, name, etc.
i have two collections of the same objects (same size list of course). items
I have two collections: Users Uploads Each upload has a User associated with it
I have two collections, Customer, and Email. Customer has a Customer.Email field and the
I have two collections, Group and User. Originally, my Group document contained an array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.