repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/persistable/settable_spec.rb | spec/mongoid/persistable/settable_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Persistable::Settable do
describe "#set" do
context "when the document is a root document" do
shared_examples_for "a settable root document" do
it "sets the normal field to the new value" do
expe... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/persistable/upsertable_spec.rb | spec/mongoid/persistable/upsertable_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Persistable::Upsertable do
describe "#upsert" do
context "when the document validates on upsert" do
let(:account) do
Account.new(name: "testing")
end
context "when the document is not valid in ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/persistable/destroyable_spec.rb | spec/mongoid/persistable/destroyable_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Persistable::Destroyable do
describe "#destroy" do
let!(:person) do
Person.create!
end
context "when destroying a readonly document" do
let(:from_db) do
Person.first.tap(&:readonly!)
end... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/persistable/minable_spec.rb | spec/mongoid/persistable/minable_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Persistable::Minable do
describe "#set_min" do
shared_examples_for 'a min-able interface' do
context "when the document is a root document" do
let(:initial_name) { "Manhattan Transfer" }
let(:initial... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/persistable/incrementable_spec.rb | spec/mongoid/persistable/incrementable_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Persistable::Incrementable do
describe "#inc" do
context "when the document is a root document" do
shared_examples_for "an incrementable root document" do
it "increments a positive value" do
expe... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/timestamps/timeless_spec.rb | spec/mongoid/timestamps/timeless_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Timestamps::Timeless do
describe "#timeless" do
before(:all) do
class Chicken
include Mongoid::Document
include Mongoid::Timestamps
before_save :lay_timeless_egg
def lay_timeless_eg... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/timestamps/created_spec.rb | spec/mongoid/timestamps/created_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Timestamps::Created do
describe ".included" do
let(:quiz) do
Quiz.new
end
let(:fields) do
Quiz.fields
end
before do
quiz.run_callbacks(:create)
quiz.run_callbacks(:save)
end
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/timestamps/updated_spec.rb | spec/mongoid/timestamps/updated_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Timestamps::Updated do
describe ".included" do
let(:agent) do
Agent.new
end
let(:fields) do
Agent.fields
end
before do
agent.run_callbacks(:create)
agent.run_callbacks(:save)
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/timestamps/created/short_spec.rb | spec/mongoid/timestamps/created/short_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Timestamps::Created::Short do
describe ".included" do
let(:quiz) do
ShortQuiz.new
end
let(:fields) do
ShortQuiz.fields
end
before do
quiz.run_callbacks(:create)
quiz.run_callbacks... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/spec/mongoid/timestamps/updated/short_spec.rb | spec/mongoid/timestamps/updated/short_spec.rb | # frozen_string_literal: true
# rubocop:todo all
require "spec_helper"
describe Mongoid::Timestamps::Updated::Short do
describe ".included" do
let(:agent) do
ShortAgent.new
end
let(:fields) do
ShortAgent.fields
end
before do
agent.run_callbacks(:create)
agent.run_call... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/examples/mongoid_test.rb | examples/mongoid_test.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid'
require 'mongoid/support/query_counter'
require 'minitest/autorun'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
Mongoid.configure.connect_to("mongoid_test")
def count_querie... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid.rb | lib/mongoid.rb | # frozen_string_literal: true
# rubocop:todo all
require "forwardable"
require "time"
require "set"
require "active_support"
require "active_support/core_ext"
require "active_support/json"
require "active_support/inflector"
require "active_support/time_with_zone"
require "active_model"
require 'concurrent-ruby'
req... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/rails/mongoid.rb | lib/rails/mongoid.rb | # frozen_string_literal: true
# rubocop:todo all
module Rails
# Mongoid utilities for Rails
module Mongoid
extend self
# Use the application configuration to get every model and require it, so
# that indexing and inheritance work in both development and production
# with the same results.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/rails/generators/mongoid_generator.rb | lib/rails/generators/mongoid_generator.rb | # frozen_string_literal: true
# rubocop:todo all
require "rails/generators/named_base"
require "rails/generators/active_model"
module Mongoid
module Generators
# Base generator class for adding Mongoid to Rails applications.
class Base < ::Rails::Generators::NamedBase
# Returns the path to the templ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/rails/generators/mongoid/model/model_generator.rb | lib/rails/generators/mongoid/model/model_generator.rb | # frozen_string_literal: true
# rubocop:todo all
require "rails/generators/mongoid_generator"
module Mongoid
module Generators
# Generator class for Mongoid model files.
class ModelGenerator < Base
desc "Creates a Mongoid model"
argument :attributes, type: :array, default: [], banner: "field:t... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/rails/generators/mongoid/config/config_generator.rb | lib/rails/generators/mongoid/config/config_generator.rb | # frozen_string_literal: true
# rubocop:todo all
require 'rails/generators/mongoid_generator'
module Mongoid
module Generators
# Generator class for Mongoid configuration files.
class ConfigGenerator < Rails::Generators::Base
desc "Creates Mongoid configuration files"
argument :database_name, ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/rails/generators/mongoid/config/templates/mongoid.rb | lib/rails/generators/mongoid/config/templates/mongoid.rb | # rubocop:todo all
Mongoid.configure do
target_version = "<%= Mongoid::VERSION[/^\d+\.\d+/] %>"
# Load Mongoid behavior defaults. This automatically sets
# features flags (refer to documentation)
config.load_defaults target_version
# It is recommended to use config/mongoid.yml for most Mongoid-related
# c... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/attributes.rb | lib/mongoid/attributes.rb | # frozen_string_literal: true
# rubocop:todo all
require "active_model/attribute_methods"
require "mongoid/attributes/dynamic"
require "mongoid/attributes/embedded"
require "mongoid/attributes/nested"
require "mongoid/attributes/processing"
require "mongoid/attributes/projector"
require "mongoid/attributes/readonly"
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/serializable.rb | lib/mongoid/serializable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module provides the extra behavior for including associations in JSON
# and XML serialization.
module Serializable
extend ActiveSupport::Concern
# We need to redefine where the JSON configuration is getting defined,
# similar to... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/deprecation.rb | lib/mongoid/deprecation.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Utility class for logging deprecation warnings.
class Deprecation < ::ActiveSupport::Deprecation
def initialize
# Per change policy, deprecations will be removed in the next major version.
deprecation_horizon = "#{Mongoid::VERSION.... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/version.rb | lib/mongoid/version.rb | # frozen_string_literal: true
module Mongoid
# The current version of Mongoid
#
# Note that this file is automatically updated via `rake candidate:create`.
# Manual changes to this file will be overwritten by that rake task.
VERSION = '9.0.2'
end
| ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/loggable.rb | lib/mongoid/loggable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Contains logging behavior.
module Loggable
# Get the logger.
#
# @note Will try to grab Rails' logger first before creating a new logger
# with stderr.
#
# @example Get the logger.
# Loggable.logger
#
# @ret... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/composable.rb | lib/mongoid/composable.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/changeable"
require "mongoid/collection_configurable"
require "mongoid/encryptable"
require "mongoid/findable"
require 'mongoid/identifiable'
require "mongoid/indexable"
require "mongoid/inspectable"
require "mongoid/interceptable"
require "mongoid/matc... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/extensions.rb | lib/mongoid/extensions.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/extensions/array"
require "mongoid/extensions/big_decimal"
require "mongoid/extensions/binary"
require "mongoid/extensions/boolean"
require "mongoid/extensions/date"
require "mongoid/extensions/date_time"
require "mongoid/extensions/decimal128"
require ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/threaded.rb | lib/mongoid/threaded.rb | # frozen_string_literal: true
require 'mongoid/threaded/lifecycle'
module Mongoid
# This module contains logic for easy access to objects that have a lifecycle
# on the current thread.
module Threaded
# The key for the shared thread- and fiber-local storage. It must be a
# symbol because keys for fiber-... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/timestamps.rb | lib/mongoid/timestamps.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/timestamps/timeless"
require "mongoid/timestamps/created"
require "mongoid/timestamps/updated"
require "mongoid/timestamps/short"
module Mongoid
# This module handles the behavior for setting up document created at and
# updated at timestamps.
m... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/search_indexable.rb | lib/mongoid/search_indexable.rb | # frozen_string_literal: true
module Mongoid
# Encapsulates behavior around managing search indexes. This feature
# is only supported when connected to an Atlas cluster.
module SearchIndexable
extend ActiveSupport::Concern
# Represents the status of the indexes returned by a search_indexes
# call.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/shardable.rb | lib/mongoid/shardable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module contains behavior for adding shard key fields to updates.
module Shardable
extend ActiveSupport::Concern
included do
# Returns the list of shard key fields, if shard key was declared on
# this model. If no shard key... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/errors.rb | lib/mongoid/errors.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/errors/mongoid_error"
require "mongoid/errors/ambiguous_relationship"
require "mongoid/errors/attribute_not_loaded"
require "mongoid/errors/callback"
require "mongoid/errors/create_collection_failure"
require "mongoid/errors/criteria_argument_required"
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/validatable.rb | lib/mongoid/validatable.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/validatable/macros"
require "mongoid/validatable/localizable"
require "mongoid/validatable/associated"
require "mongoid/validatable/format"
require "mongoid/validatable/length"
require "mongoid/validatable/numericality"
require "mongoid/validatable/quer... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/reloadable.rb | lib/mongoid/reloadable.rb | # frozen_string_literal: true
module Mongoid
# This module handles reloading behavior of documents.
module Reloadable
# Reloads the +Document+ attributes from the database. If the document has
# not been saved then an error will get raised if the configuration option
# was set. This can reload root doc... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/traversable.rb | lib/mongoid/traversable.rb | # frozen_string_literal: true
require 'mongoid/fields/validators/macro'
require 'mongoid/model_resolver'
module Mongoid
# Mixin module included in Mongoid::Document to provide behavior
# around traversing the document graph.
module Traversable
extend ActiveSupport::Concern
# This code is extracted from ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/pluckable.rb | lib/mongoid/pluckable.rb | # frozen_string_literal: true
module Mongoid
# Provides shared behavior for any document with "pluck" functionality.
#
# @api private
module Pluckable
extend ActiveSupport::Concern
private
# Prepares the field names for plucking by normalizing them to their
# database field names. Also prepar... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/utils.rb | lib/mongoid/utils.rb | # frozen_string_literal: true
module Mongoid
# Utility functions for Mongoid.
#
# @api private
module Utils
extend self
# A unique placeholder value that will never accidentally collide with
# valid values. This is useful as a default keyword argument value when
# you want the argument to be o... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/interceptable.rb | lib/mongoid/interceptable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module contains all the callback hooks for Mongoid.
module Interceptable
extend ActiveSupport::Concern
CALLBACKS = [
:after_build,
:after_create,
:after_destroy,
:after_find,
:after_initialize,
:aft... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/warnings.rb | lib/mongoid/warnings.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Encapsulates behavior around logging and caching warnings so they are only
# logged once.
#
# @api private
module Warnings
class << self
# Define a warning message method for the given id.
#
# @param [ Symbol ] id The ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/equality.rb | lib/mongoid/equality.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module contains the behavior of Mongoid's clone/dup of documents.
module Equality
# Leave the current contents of this module outside of InstanceMethods
# to prevent cherry picking conflicts. For now...
extend ActiveSupport::Concer... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/copyable.rb | lib/mongoid/copyable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module contains the behavior of Mongoid's clone/dup of documents.
module Copyable
extend ActiveSupport::Concern
# Clone or dup the current +Document+. This will return all attributes with
# the exception of the document's id, and ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/changeable.rb | lib/mongoid/changeable.rb | # frozen_string_literal: true
module Mongoid
# Defines behavior for dirty tracking.
module Changeable
extend ActiveSupport::Concern
# Get the changed attributes for the document.
#
# @example Get the changed attributes.
# model.changed
#
# @return [ Array<String> ] The changed attrib... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/fields.rb | lib/mongoid/fields.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/fields/standard"
require "mongoid/fields/encrypted"
require "mongoid/fields/foreign_key"
require "mongoid/fields/localized"
require "mongoid/fields/validators"
module Mongoid
# This module defines behavior for fields.
module Fields
extend Acti... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/collection_configurable.rb | lib/mongoid/collection_configurable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Encapsulates behavior around defining collections.
module CollectionConfigurable
extend ActiveSupport::Concern
module ClassMethods
# Create the collection for the called upon Mongoid model.
#
# This method does not re-cre... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/positional.rb | lib/mongoid/positional.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module is responsible for taking update selectors and switching out
# the indexes for the $ positional operator where appropriate.
module Positional
# Takes the provided selector and atomic operations and replaces the
# indexes of t... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/railtie.rb | lib/mongoid/railtie.rb | # frozen_string_literal: true
# rubocop:todo all
require "rails"
require "rails/mongoid"
module Rails
module Mongoid
# Hooks Mongoid into Rails 3 and higher.
class Railtie < Rails::Railtie
console do |app|
if app.sandbox?
require "mongoid/railties/console_sandbox"
start_s... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/evolvable.rb | lib/mongoid/evolvable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Contains behavior specific to evolving for queryable queries.
module Evolvable
# Evolve the document into an object id.
#
# @example Evolve the document.
# document.__evolve_object_id__
#
# @return [ Object ] The document... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic.rb | lib/mongoid/atomic.rb | # frozen_string_literal: true
require 'mongoid/atomic/modifiers'
require 'mongoid/atomic/paths'
module Mongoid
# This module contains the logic for supporting atomic operations against the
# database.
module Atomic
extend ActiveSupport::Concern
UPDATES = %i[
atomic_array_pushes
atomic_array... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher.rb | lib/mongoid/matcher.rb | # rubocop:todo all
module Mongoid
# Utility module containing methods which assist in performing
# in-memory matching of documents with MQL query expressions.
#
# @api private
module Matcher
# Extracts field values in the document at the specified key.
#
# The document can be a Hash or a model in... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/findable.rb | lib/mongoid/findable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module defines the finder methods that hang off the document at the
# class level.
module Findable
extend Forwardable
def_delegators :with_default_scope, *(
Criteria::Queryable::Selectable.forwardables +
Criteria::Querya... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/stringified_symbol.rb | lib/mongoid/stringified_symbol.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# A class which sends values to the database as Strings but returns
# them to the user as Symbols.
class StringifiedSymbol
class << self
# Convert the object from its mongo friendly ruby type to this type.
#
# @example Demon... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matchable.rb | lib/mongoid/matchable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module contains all the behavior for Ruby implementations of MongoDB
# selectors.
module Matchable
extend ActiveSupport::Concern
# Determines if this document has the attributes to match the supplied
# MongoDB selector. Used for... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/indexable.rb | lib/mongoid/indexable.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/indexable/specification"
require "mongoid/indexable/validators/options"
require "ostruct"
module Mongoid
# Encapsulates behavior around defining indexes.
module Indexable
extend ActiveSupport::Concern
included do
cattr_accessor :ind... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/selectable.rb | lib/mongoid/selectable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Provides behavior for generating the selector for a specific document.
module Selectable
extend ActiveSupport::Concern
# Get the atomic selector for the document. This is a hash in the simplest
# case { "_id" => id }, but can become mo... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistable.rb | lib/mongoid/persistable.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/persistable/creatable"
require "mongoid/persistable/deletable"
require "mongoid/persistable/destroyable"
require "mongoid/persistable/incrementable"
require "mongoid/persistable/logical"
require "mongoid/persistable/maxable"
require "mongoid/persistable... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/persistence_context.rb | lib/mongoid/persistence_context.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Object encapsulating logic for setting/getting a collection and database name
# and a client with particular options to use when persisting models.
class PersistenceContext
extend Forwardable
# Delegate the cluster method to the client.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/contextual.rb | lib/mongoid/contextual.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/contextual/queryable"
require "mongoid/contextual/mongo"
require "mongoid/contextual/memory"
require "mongoid/contextual/none"
module Mongoid
# Parent mixin module which adds aggregation (#sum, #avg, etc.) and
# atomic (#set, #unset, #push, etc.) ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/loadable.rb | lib/mongoid/loadable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Defines how Mongoid can autoload all defined models.
module Loadable
# The default list of paths where model classes should be looked for. If
# Rails is present, the "app/models" paths will be used instead.
# (See #model_paths.)
DEF... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/inspectable.rb | lib/mongoid/inspectable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Contains the behavior around inspecting documents via inspect.
module Inspectable
# Returns the class name plus its attributes. If using dynamic fields will
# include those as well.
#
# @example Inspect the document.
# person... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/atomic_update_preparer.rb | lib/mongoid/atomic_update_preparer.rb | # frozen_string_literal: true
module Mongoid
# A singleton class to assist with preparing attributes for atomic
# updates.
#
# Once the deprecated Hash#__consolidate__ method is removed entirely,
# these methods may be moved into Mongoid::Contextual::Mongo as private
# methods.
#
# @api private
class... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/model_resolver.rb | lib/mongoid/model_resolver.rb | # frozen_string_literal: true
require 'forwardable'
module Mongoid
# The default class for resolving model classes based on discriminant keys.
# Given a key, it will return the corresponding model class, if any. By
# default, it looks for classes with names that match the given keys, but
# additional mappings... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/config.rb | lib/mongoid/config.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/config/defaults"
require "mongoid/config/environment"
require "mongoid/config/options"
require "mongoid/config/validators"
require "mongoid/config/introspection"
require "mongoid/config/encryption"
module Mongoid
# This module defines all the config... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/factory.rb | lib/mongoid/factory.rb | # frozen_string_literal: true
module Mongoid
# Instantiates documents that came from the database.
module Factory
extend self
# A helper class for instantiating a model using either its type
# class directly, or via a type class specified via a discriminator
# key.
#
# @api private
cla... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/clients.rb | lib/mongoid/clients.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/clients/factory"
require "mongoid/clients/validators"
require "mongoid/clients/storage_options"
require "mongoid/clients/options"
require "mongoid/clients/sessions"
module Mongoid
# Mixin module included into Mongoid::Document which adds
# databas... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/touchable.rb | lib/mongoid/touchable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Mixin module which is included in Mongoid::Document to add "touch"
# functionality to update a document's timestamp(s) atomically.
module Touchable
# Used to provide mixin functionality.
#
# @todo Refactor using ActiveSupport::Concer... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/cacheable.rb | lib/mongoid/cacheable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Encapsulates behavior around caching.
module Cacheable
extend ActiveSupport::Concern
included do
cattr_accessor :cache_timestamp_format, instance_writer: false
self.cache_timestamp_format = :nsec
end
# Print out the ca... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/encryptable.rb | lib/mongoid/encryptable.rb | # rubocop:todo all
module Mongoid
# This module is used to extend Mongoid::Document
# to add encryption functionality.
module Encryptable
extend ActiveSupport::Concern
included do
# @return [Hash] The encryption metadata for the model.
class_attribute :encrypt_metadata
self.encrypt_meta... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/scopable.rb | lib/mongoid/scopable.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# This module contains behavior for all Mongoid scoping - named scopes,
# default scopes, and criteria accessors via scoped and unscoped.
module Scopable
extend ActiveSupport::Concern
included do
class_attribute :default_scoping
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/criteria.rb | lib/mongoid/criteria.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/criteria/findable"
require "mongoid/criteria/includable"
require "mongoid/criteria/inspectable"
require "mongoid/criteria/marshalable"
require "mongoid/criteria/modifiable"
require "mongoid/criteria/queryable"
require "mongoid/criteria/scopable"
require... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/document.rb | lib/mongoid/document.rb | # frozen_string_literal: true
require 'mongoid/positional'
require 'mongoid/evolvable'
require 'mongoid/extensions'
require 'mongoid/errors'
require 'mongoid/threaded'
require 'mongoid/atomic'
require 'mongoid/attributes'
require 'mongoid/contextual'
require 'mongoid/copyable'
require 'mongoid/equality'
require 'mongo... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/association.rb | lib/mongoid/association.rb | # frozen_string_literal: true
# rubocop:todo all
require 'mongoid/association/accessors'
require 'mongoid/association/builders'
require 'mongoid/association/bindable'
require 'mongoid/association/depending'
require 'mongoid/association/proxy'
require 'mongoid/association/many'
require 'mongoid/association/one'
requir... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/identifiable.rb | lib/mongoid/identifiable.rb | # frozen_string_literal: true
require 'mongoid/model_resolver'
module Mongoid
# Implements the "identify_as" interface (for specifying type aliases
# for document classes).
module Identifiable
extend ActiveSupport::Concern
class_methods do
# Specifies aliases that may be used to identify this doc... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/stateful.rb | lib/mongoid/stateful.rb | # frozen_string_literal: true
# rubocop:todo all
module Mongoid
# Mixin module included into Mongoid::Document which adds behavior for
# getting the various lifecycle states a document can transition through.
module Stateful
attr_writer :destroyed, :flagged_for_destroy, :previously_new_record
# Sets w... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/deprecable.rb | lib/mongoid/deprecable.rb | # frozen_string_literal: true
# rubocop:todo all
require "mongoid/deprecation"
module Mongoid
# Adds ability to declare Mongoid-specific deprecations.
#
# @api private
module Deprecable
# Declares method(s) as deprecated.
#
# @example Deprecate a method.
# Mongoid.deprecate(Cat, :meow); Ca... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/elem_match_expression.rb | lib/mongoid/matcher/elem_match_expression.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher used to evaluate whether an $elemMatch predicate
# matches and individual document. The $elemMatch predicate can be a
# logical expressions including $and, $or, $nor, and $not. $not can
# also have a regular expression predicate.
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/mod.rb | lib/mongoid/matcher/mod.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $mod expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/mod/
#
# @api private
module Mod
# Returns whether a value satisfies a $mod expression.
#
# @param [ true | false ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/in.rb | lib/mongoid/matcher/in.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $in expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/in/
#
# @api private
module In
# Returns whether a value satisfies an $in expression.
#
# @param [ true | false ] e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/type.rb | lib/mongoid/matcher/type.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $type expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/type/
#
# @api private
module Type
# Returns whether a value satisfies a $type expression.
#
# @param [ true | fa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/bits.rb | lib/mongoid/matcher/bits.rb | # rubocop:todo all
module Mongoid
module Matcher
# Mixin module included in bitwise expression matchers.
#
# @api private
module Bits
# Returns whether a value satisfies a bitwise expression.
#
# @param [ true | false ] exists Not used.
# @param [ Object ] value The value to ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/bits_all_clear.rb | lib/mongoid/matcher/bits_all_clear.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $bitsAllClear expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/
#
# @api private
module BitsAllClear
include Bits
extend self
# Returns whether a position ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/nin.rb | lib/mongoid/matcher/nin.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $nin expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/nin/
#
# @api private
module Nin
# Returns whether a value satisfies a $nin expression.
#
# @param [ true | false ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/nor.rb | lib/mongoid/matcher/nor.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $nor expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/nor/
#
# @api private
module Nor
# Returns whether a document satisfies a $nor expression.
#
# @param [ Mongoid::D... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/or.rb | lib/mongoid/matcher/or.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $or expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/or/
#
# @api private
module Or
# Returns whether a document satisfies an $or expression.
#
# @param [ Mongoid::Docu... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/and.rb | lib/mongoid/matcher/and.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $and expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/and/
#
# @api private
module And
# Returns whether a document satisfies an $and expression.
#
# @param [ Mongoid::... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/ne.rb | lib/mongoid/matcher/ne.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $ne expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/ne/
#
# @api private
module Ne
# Returns whether a value satisfies an $ne expression.
#
# @param [ true | false ] e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/eq_impl_with_regexp.rb | lib/mongoid/matcher/eq_impl_with_regexp.rb | # rubocop:todo all
module Mongoid
module Matcher
# This is an internal equality implementation that performs exact
# comparisons and regular expression matches.
#
# @api private
module EqImplWithRegexp
# Returns whether a value satisfies an $eq (or similar) expression,
# performing a... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/lt.rb | lib/mongoid/matcher/lt.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $lt expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/lt/
#
# @api private
module Lt
# Returns whether a value satisfies a $lt expression.
#
# @param [ true | false ] ex... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/bits_any_clear.rb | lib/mongoid/matcher/bits_any_clear.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $bitsAnyClear expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/
#
# @api private
module BitsAnyClear
include Bits
extend self
# Returns whether a position ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/size.rb | lib/mongoid/matcher/size.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $size expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/size/
#
# @api private
module Size
# Returns whether a value satisfies a $size expression.
#
# @param [ true | fa... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/expression_operator.rb | lib/mongoid/matcher/expression_operator.rb | # rubocop:todo all
module Mongoid
module Matcher
# Singleton module provides lookup of logical query operator
# matchers.
#
# @api private
module ExpressionOperator
MAP = {
'$and' => And,
'$nor' => Nor,
'$or' => Or,
}.freeze
# Returns the matcher module ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/not.rb | lib/mongoid/matcher/not.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $not expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/not/
#
# @api private
module Not
# Returns whether a value satisfies an $not expression.
#
# @param [ true | false... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/field_operator.rb | lib/mongoid/matcher/field_operator.rb | # rubocop:todo all
module Mongoid
module Matcher
# Singleton module provides lookup of query operator matchers
# related to field values.
#
# @api private
module FieldOperator
MAP = {
'$all' => All,
'$bitsAllClear' => BitsAllClear,
'$bitsAllSet' => BitsAllSet,
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/elem_match.rb | lib/mongoid/matcher/elem_match.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $elemMatch expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/
#
# @api private
module ElemMatch
# Returns whether a value satisfies an $elemMatch expression.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/eq_impl.rb | lib/mongoid/matcher/eq_impl.rb | # rubocop:todo all
module Mongoid
module Matcher
# This module is used by $eq and other operators that need to perform
# the matching that $eq performs (for example, $ne which negates the result
# of $eq). Unlike $eq this module takes an original operator as an
# additional argument to +matches?+ to ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/gte.rb | lib/mongoid/matcher/gte.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $gte expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/gte/
#
# @api private
module Gte
# Returns whether a value satisfies a $gte expression.
#
# @param [ true | false ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/regex.rb | lib/mongoid/matcher/regex.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $regex expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/regex/
#
# @api private
module Regex
# Returns whether a value satisfies a $regex expression.
#
# @param [ true ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/lte.rb | lib/mongoid/matcher/lte.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $lte expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/lte/
#
# @api private
module Lte
# Returns whether a value satisfies a $lte expression.
#
# @param [ true | false ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/eq.rb | lib/mongoid/matcher/eq.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $eq expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/eq/
#
# @api private
module Eq
# Returns whether a value satisfies an $eq expression.
#
# @param [ true | false ] e... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/bits_all_set.rb | lib/mongoid/matcher/bits_all_set.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $bitsAllSet expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/
#
# @api private
module BitsAllSet
include Bits
extend self
# Returns whether a position list c... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/expression.rb | lib/mongoid/matcher/expression.rb | # rubocop:todo all
module Mongoid
module Matcher
# Base singleton module used for evaluating whether a given
# document in-memory matches an MSQL query expression.
#
# @api private
module Expression
# Returns whether a document satisfies a query expression.
#
# @param [ Mongoid... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/bits_any_set.rb | lib/mongoid/matcher/bits_any_set.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $bitsAnySet expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/
#
# @api private
module BitsAnySet
include Bits
extend self
# Returns whether a position list c... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/exists.rb | lib/mongoid/matcher/exists.rb | # rubocop:todo all
module Mongoid
module Matcher
# In-memory matcher for $exists expression.
#
# @see https://www.mongodb.com/docs/manual/reference/operator/query/exists/
#
# @api private
module Exists
# Returns whether an $exists expression is satisfied.
#
# @param [ true ... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
mongodb/mongoid | https://github.com/mongodb/mongoid/blob/780b2fd823670611d49b3470d6b492e2a19dacf5/lib/mongoid/matcher/field_expression.rb | lib/mongoid/matcher/field_expression.rb | # rubocop:todo all
module Mongoid
module Matcher
# Singleton module used for evaluating whether a given
# value in-memory matches an MSQL query expression related
# to a specific field.
#
# @api private
module FieldExpression
# Returns whether a value satisfies a condition.
#
... | ruby | MIT | 780b2fd823670611d49b3470d6b492e2a19dacf5 | 2026-01-04T15:47:58.642616Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.