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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:59:54+00:00 2026-06-14T21:59:54+00:00

In former version of Mongoid I would write: Clothes.where($or => [{$and => [{_type: Shoes},

  • 0

In former version of Mongoid I would write:

Clothes.where("$or" => [{"$and" => [{_type: "Shoes"}, {is_secondhand: false}]}, 
                        {"$and"=> [{_type: "Shirts"}, {is_secondhand: true}]}])

How should I write that in Mongoid 3.0.13?

  • 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-14T21:59:56+00:00Added an answer on June 14, 2026 at 9:59 pm

    You probably don’t need those ands.

    Try this:

    Clothes.or({_type: "Shoes", is_secondhand: false},
               {_type: "Shirts", is_secondhand: true})
    

    A lot has changed in Mongoid 3 and most of the querying selectors were moved to Origin. Have a look at the Origin documentation.

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

Sidebar

Related Questions

My client wants to update an old tt-news installation version 2.x. Unfortunately the former
I've been reading Filthy Rich Clients lately and noticed that, although the version of
Answers to this question explain that for example jquery-1.5.1.min.js is a minified version of
In former versions of Parallel Extensions you could set the number of threads: enumerable.AsParallel(numberOfThreads)
There are a lot of former Java developers at my company who use camel
The following url is formed in my rails application, http://example.com/filter/filters?binding_id=1>1&escape=false&filter_type=publisher_id&from_pagination=0&genre_id=0>57&order=3&page=8&publisher_id=3>160&query=books&search_case=products&sub_category_id=1&tree_filter_id=115&utf8=%E2%9C%93&view_name=generic2d4e4c5333133cd814a2cb102571e4dc Is this OK? If
I have a Dictionary object that is formed using a double as its key.
Recently I have been informed that it is possible to concatenate integers (and other
As I write most of my code using MacVIM, I need to add the
I'm finally getting started with version control after getting about 40% of the way

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.