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 🙂
I think you want to use this:
Take a look at here: MongoId-Matchers-NE