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

  • SEARCH
  • Home
  • 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 8476253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:07:44+00:00 2026-06-10T18:07:44+00:00

I have two collections: – Post – Comment Post.comments = [comment1, comment2, …] comment.removed

  • 0

I have two collections:

- Post
- Comment

Post.comments = [comment1, comment2, ...]

comment.removed is a boolean.

I’d like to fetch all Posts but exclude comments which are removed. Is there a way to do it without iterating over the OneToMany relationship ?

Here is what I tried:

ANY comments.removed == FALSE  // Posts that have at least one removed comment
ALL comments.removed == FALSE  // Posts that only have unremoved comments
(SUBQUERY(comments, $x, $x.removed == FALSE).@count > 0) // Same as the first one
  • 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-06-10T18:07:46+00:00Added an answer on June 10, 2026 at 6:07 pm

    If I understand your problem correctly, you would like to get all “Post” objects, but post.comments should not be the entire set of comments as defined in the Core Data store, but only the set of comments that are not removed.

    This is not possible (as far as I know) with a fetch request, because the result of a fetch request is a list of objects in the managed object context. A fetch request can not return new objects that are different from their original in the managed object context.

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

Sidebar

Related Questions

Supposing I have two collections, posts and comments. post = { _id: 1, language:
I have two collections a and b . I would like to compute the
I have two collections. people are connected with a location like so: location_id =
I have two IEnumerable collections that I would like to union. One selects news
I have two collections of type ICollection<MyType> called c1 and c2 . I'd like
Consider I have two collections in MongoDB. One for products with documents like: {'_id':
I have two collections displayed in my WPF application, and I'd like to have
I have two collections as below which hold IDs for Students. The ids are
I have two generic collections in my code, EventableCollection and EventableSortedList - which are
I have a class which has two HashSet<String> collections as private members. Other classes

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.