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 7811815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:18:18+00:00 2026-06-02T04:18:18+00:00

Happily using Mongoid and ActiveRecord like this: Task.where(project_id: params[:project_id], archived_at: nil) # find me

  • 0

Happily using Mongoid and ActiveRecord like this:

Task.where(project_id: params[:project_id], archived_at: nil)
# find me the tasks for project_id that haven't been archived

But what’s a straightforward way for saying the opposite?

# find me the tasks for project_id that have been archived
# i.e. where archived_at is not nil

Can’t figure out or find out the inverse of the first line of code.
I assume it should be straightforward 🙂

  • 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-02T04:18:19+00:00Added an answer on June 2, 2026 at 4:18 am

    I think you want to use this:

    :archived_at.ne => nil 
    

    Take a look at here: MongoId-Matchers-NE

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

Sidebar

Related Questions

I'm happily using proc_open to pipe data into another PHP process. something like this
I am very happily using git-svn, though I noticed that git has a different
This may be somewhat obscure but I've been happily using Eclipse + Perfoce/P4WSAD for
I was happily using outline property until I came to know that it is
For the past 4 months or so we've been happily using this query: SELECT
I'm happily using this autocompleter: http://code.google.com/p/jquery-autocomplete/ . I need to change the width of
After happily using open source software for many years I've figured it's time to
I have been happily using HgSubversion for awhile and today I forgot to add
I've been very happily using PredicateBuilder but until now have only used it for
So I can call my IPN handling page (an aspx page) happily using Fiddler

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.