Módulo: Mongoide
- Estendido por:
- Forwardable, Mongoid, Clients::Sessions::ClassMethods, Deprecable, GlobalDiscriminatorKeyAssignment, Loadable, Loggable
- Incluído em:
- Mongoid
- Definido em:
- lib/mongoid.rb,
lib/mongoid/utils.rb,
lib/mongoid/atomic.rb,
lib/mongoid/config.rb,
lib/mongoid/fields.rb,
lib/mongoid/clients.rb,
lib/mongoid/factory.rb,
lib/mongoid/matcher.rb,
lib/mongoid/version.rb,
lib/mongoid/copyable.rb,
lib/mongoid/criteria.rb,
lib/mongoid/ documento.rb,
lib/mongoid/equality.rb,
lib/mongoid/findable.rb,
lib/mongoid/loadable.rb,
lib/mongoid/loggable.rb,
lib/mongoid/scopable.rb,
lib/mongoid/stateful.rb,
lib/mongoid/threaded.rb,
lib/mongoid/writes.rb,
lib/mongoid/cacheable.rb,
lib/mongoid/evolvable.rb,
lib/mongoid/indexable.rb,
lib/mongoid/matchable.rb,
lib/mongoid/shardable.rb,
lib/mongoid/tocable.rb,
lib/mongoid/attributes.rb,
lib/mongoid/changeable.rb,
lib/mongoid/composable.rb,
lib/mongoid/contextual.rb,
lib/mongoid/deprecable.rb,
lib/mongoid/matcher/eq.rb,
lib/mongoid/matcher/gt.rb,
lib/mongoid/matcher/in.rb,
lib/mongoid/matcher/lt.rb,
lib/mongoid/matcher/ne.rb,
lib/mongoid/matcher/or.rb,
lib/mongoid/positional.rb,
lib/mongoid/reloadable.rb,
lib/mongoid/selectable.rb,
lib/mongoid/timestamps.rb,
lib/mongoid/association.rb,
lib/mongoid/deprecation.rb,
lib/mongoid/encryptable.rb,
lib/mongoid/matcher/all.rb,
lib/mongoid/matcher/and.rb,
lib/mongoid/matcher/gte.rb,
lib/mongoid/matcher/lte.rb,
lib/mongoid/matcher/mod.rb,
lib/mongoid/matcher/nin.rb,
lib/mongoid/matcher/nor.rb,
lib/mongoid/matcher/not.rb,
lib/mongoid/persistable.rb,
lib/mongoid/traversable.rb,
lib/mongoid/validatable.rb,
lib/mongoid/matcher/bits.rb,
lib/mongoid/matcher/size.rb,
lib/mongoid/matcher/type.rb,
lib/mongoid/serializable.rb,
lib/mongoid/interceptable.rb,
lib/mongoid/matcher/regex.rb,
lib/mongoid/config/options.rb,
lib/mongoid/extensions/set.rb,
lib/mongoid/matcher/exists.rb,
lib/mongoid/tasks/ banco de dados.rb,
lib/mongoid/association/one.rb,
lib/mongoid/clients/factory.rb,
lib/mongoid/clients/options.rb,
lib/mongoid/config/defaults.rb,
lib/mongoid/contextual/none.rb,
lib/mongoid/errors/ chamada de resposta.rb,
lib/mongoid/errors/rollback.rb,
lib/mongoid/extensions/date.rb,
lib/mongoid/extentions/hash.rb,
lib/mongoid/extentions/time.rb,
lib/mongoid/fields/standard.rb,
lib/mongoid/matcher/eq_impl.rb,
lib/mongoid/association/many.rb,
lib/mongoid/atomic/modifiers.rb,
lib/mongoid/clients/sessions.rb,
lib/mongoid/contextual/mongo.rb,
lib/mongoid/criteria/options.rb,
lib/mongoid/errors/no_parent.rb,
lib/mongoid/extentions/array.rb,
lib/mongoid/extentions/float.rb,
lib/mongoid/extensions/range.rb,
lib/mongoid/fields/encrypted.rb,
lib/mongoid/fields/localized.rb,
lib/mongoid/search_indexable.rb,
lib/mongoid/tasks/encryption.rb,
lib/mongoid/timestamps/short.rb,
lib/mongoid/association/eager.rb,
lib/mongoid/association/proxy.rb,
lib/mongoid/atomic/paths/root.rb,
lib/mongoid/attributes/nested.rb,
lib/mongoid/config/encryption.rb,
lib/mongoid/contextual/atomic.rb,
lib/mongoid/contextual/memory.rb,
lib/mongoid/criteria/findable.rb,
lib/mongoid/criteria/scopable.rb,
lib/mongoid/extentions/binary.rb,
lib/mongoid/extentions/module.rb,
lib/mongoid/extentions/ objeto.rb,
lib/mongoid/extensions/regexp.rb,
lib/mongoid/extentions/string.rb,
lib/mongoid/extensions/symbol.rb,
lib/mongoid/association/macros.rb,
lib/mongoid/association/nested.rb,
lib/mongoid/attributes/dynamic.rb,
lib/mongoid/config/environment.rb,
lib/mongoid/contextual/command.rb,
lib/mongoid/criteria/queryable.rb,
lib/mongoid/errors/no_metadata.rb,
lib/mongoid/errors/validations.rb,
lib/mongoid/extensions/boolean.rb,
lib/mongoid/extensions/integer.rb,
lib/mongoid/fields/foreign_key.rb,
lib/mongoid/matcher/elem_match.rb,
lib/mongoid/matcher/ expressão.rb,
lib/mongoid/stringified_symbol.rb,
lib/mongoid/threaded/Lifecycle.rb,
lib/mongoid/timestamps/created.rb,
lib/mongoid/timestamps/updated.rb,
lib/mongoid/validatable/format.rb,
lib/mongoid/validatable/long.rb,
lib/mongoid/validatable/macros.rb,
lib/mongoid/association/options.rb,
lib/mongoid/attributes/embedded.rb,
lib/mongoid/attributes/readonly.rb,
lib/mongoid/contextual/geo_near.rb,
lib/mongoid/criteria/includable.rb,
lib/mongoid/criteria/modavailable.rb,
lib/mongoid/criteria/permission.rb,
lib/mongoid/criteria/translator.rb,
lib/mongoid/errors/invalid_find.rb,
lib/mongoid/errors/invalid_path.rb,
lib/mongoid/errors/invalid_time.rb,
lib/mongoid/persistable/logical.rb,
lib/mongoid/persistable/maxable.rb,
lib/mongoid/persistable/minable.rb,
lib/mongoid/persistable/sovable.rb,
lib/mongoid/persistence_context.rb,
lib/mongoid/timestamps/timeless.rb,
lib/mongoid/association/bindable.rb,
lib/mongoid/association/builders.rb,
lib/mongoid/attributes/projector.rb,
lib/mongoid/contextual/queryable.rb,
lib/mongoid/criteria/marshable.rb,
lib/mongoid/errors/invalid_field.rb,
lib/mongoid/errors/invalid_index.rb,
lib/mongoid/errors/invalid_query.rb,
lib/mongoid/errors/invalid_scope.rb,
lib/mongoid/errors/mongoid_error.rb,
lib/mongoid/errors/unknown_model.rb,
lib/mongoid/extentions/date_time.rb,
lib/mongoid/extentions/nil_class.rb,
lib/mongoid/extentions/object_id.rb,
lib/mongoid/extentions/raw_value.rb,
lib/mongoid/matcher/bits_all_set.rb,
lib/mongoid/matcher/bits_any_set.rb,
lib/mongoid/persistable/poppable.rb,
lib/mongoid/persistable/pullable.rb,
lib/mongoid/persistable/pushable.rb,
lib/mongoid/persistable/settable.rb,
lib/mongoid/validatable/Presence.rb,
lib/mongoid/association/accessors.rb,
lib/mongoid/association/depending.rb,
lib/mongoid/association/relatable.rb,
lib/mongoid/atomic/paths/embedded.rb,
lib/mongoid/attributes/processing.rb,
lib/mongoid/contextual/aggregable.rb,
lib/mongoid/contextual/map_reduce.rb,
lib/mongoid/errors/no_environment.rb,
lib/mongoid/extentions/decimal128.rb,
lib/mongoid/extentions/true_class.rb,
lib/mongoid/persistable/createtable.rb,
lib/mongoid/persistable/deletable.rb,
lib/mongoid/persistable/renamable.rb,
lib/mongoid/persistable/updatable.rb,
lib/mongoid/validatable/queryable.rb,
lib/mongoid/association/nested/one.rb,
lib/mongoid/atomic_update_preparer.rb,
lib/mongoid/criteria/queryable/key.rb,
lib/mongoid/errors/invalid_options.rb,
lib/mongoid/errors/mixed_relations.rb,
lib/mongoid/errors/no_client_hosts.rb,
lib/mongoid/errors/scope_overwrite.rb,
lib/mongoid/extentions/big_decimal.rb,
lib/mongoid/extentions/false_class.rb,
lib/mongoid/matcher/bits_all_clear.rb,
lib/mongoid/matcher/bits_any_clear.rb,
lib/mongoid/matcher/field_operator.rb,
lib/mongoid/persistable/unsettable.rb,
lib/mongoid/persistable/upsertable.rb,
lib/mongoid/validatable/associated.rb,
lib/mongoid/validatable/uniqueness.rb,
lib/mongoid/association/marshardable.rb,
lib/mongoid/association/nested/many.rb,
lib/mongoid/association/reflections.rb,
lib/mongoid/clients/storage_options.rb,
lib/mongoid/collection_configurable.rb,
lib/mongoid/errors/invalid_includes.rb,
lib/mongoid/errors/invalid_relation.rb,
lib/mongoid/errors/no_client_config.rb,
lib/mongoid/errors/unsaved_document.rb,
lib/mongoid/fields/validators/macro.rb,
lib/mongoid/persistable/destroyable.rb,
lib/mongoid/validatable/localizable.rb,
lib/mongoid/config/validators/ cliente.rb,
lib/mongoid/config/validators/option.rb,
lib/mongoid/criteria/queryable/smash.rb,
lib/mongoid/errors/empty_config_file.rb,
lib/mongoid/errors/inverse_not_Found.rb,
lib/mongoid/errors/no_clients_config.rb,
lib/mongoid/errors/no_default_client.rb,
lib/mongoid/errors/readonly_document.rb,
lib/mongoid/errors/transaction_error.rb,
lib/mongoid/errors/unknown_attribute.rb,
lib/mongoid/matcher/field_expression.rb,
lib/mongoid/persistable/multipliable.rb,
lib/mongoid/timestamps/created/short.rb,
lib/mongoid/timestamps/updated/short.rb,
lib/mongoid/association/constrainable.rb,
lib/mongoid/atomic/paths/embedded/one.rb,
lib/mongoid/errors/delete_restriction.rb,
lib/mongoid/errors/document_not_Found.rb,
lib/mongoid/errors/invalid_collection.rb,
lib/mongoid/errors/invalid_field_type.rb,
lib/mongoid/errors/no_client_database.rb,
lib/mongoid/errors/readonly_attribute.rb,
lib/mongoid/extentions/time_with_zone.rb,
lib/mongoid/persistable/incrementable.rb,
lib/mongoid/association/eager_loadable.rb,
lib/mongoid/association/embedded/eager.rb,
lib/mongoid/atomic/paths/embedded/many.rb,
lib/mongoid/clients/validators/storage.rb,
lib/mongoid/contextual/aggregable/none.rb,
lib/mongoid/criteria/queryable/options.rb,
lib/mongoid/errors/immutable_attribute.rb,
lib/mongoid/errors/invalid_config_file.rb,
lib/rails/generators/mongoid_generator.rb,
lib/mongoid/association/embedded/cycle.rb,
lib/mongoid/contextual/aggregable/mongo.rb,
lib/mongoid/criteria/queryable/optional.rb,
lib/mongoid/criteria/queryable/pipeline.rb,
lib/mongoid/criteria/queryable/selector.rb,
lib/mongoid/criteria/queryable/storable.rb,
lib/mongoid/errors/attribute_not_loaded.rb,
lib/mongoid/errors/invalid_field_option.rb,
lib/mongoid/errors/no_map_reduce_output.rb,
lib/mongoid/matcher/eq_impl_with_regexp.rb,
lib/mongoid/matcher/expression_operator.rb,
lib/mongoid/railties/controller_runtime.rb,
lib/mongoid/contextual/aggregable/memory.rb,
lib/mongoid/criteria/queryable/macroable.rb,
lib/mongoid/criteria/queryable/mergeable.rb,
lib/mongoid/errors/invalid_config_option.rb,
lib/mongoid/indexable/validators/options.rb,
lib/mongoid/criteria/queryable/aggregable.rb,
lib/mongoid/criteria/queryable/expandable.rb,
lib/mongoid/criteria/queryable/selectable.rb,
lib/mongoid/errors/ambiguous_relationship.rb,
lib/mongoid/errors/document_not_destroyed.rb,
lib/mongoid/errors/invalid_field_operator.rb,
lib/mongoid/errors/sessions_not_supported.rb,
lib/mongoid/errors/unsupported_javascript.rb,
lib/mongoid/matcher/elem_match_expression.rb,
lib/mongoid/association/embedded/batchable.rb,
lib/mongoid/association/referenced/has_one.rb,
lib/mongoid/errors/drop_collection_failure.rb,
lib/mongoid/errors/invalid_relation_option.rb,
lib/mongoid/errors/invalid_session_nesting.rb,
lib/mongoid/errors/invalid_storage_options.rb,
lib/mongoid/association/embedded/embeds_one.rb,
lib/mongoid/association/referenced/has_many.rb,
lib/mongoid/association/referenced/syncable.rb,
lib/mongoid/association/embedded/embedded_in.rb,
lib/mongoid/association/embedded/embeds_many.rb,
lib/mongoid/association/referenced/auto_save.rb,
lib/mongoid/errors/create_collection_failure.rb,
lib/mongoid/association/referenced/belongs_to.rb,
lib/mongoid/contextual/mongo/documents_loader.rb,
lib/mongoid/criteria/queryable/extensions/set.rb,
lib/mongoid/errors/criteria_argument_required.rb,
lib/mongoid/errors/invalid_depende_strategy.rb,
lib/mongoid/errors/invalid_persistence_option.rb,
lib/mongoid/errors/mixed_client_configuration.rb,
lib/mongoid/errors/transactions_not_supported.rb,
lib/mongoid/criteria/queryable/extensions/date.rb,
lib/mongoid/criteria/queryable/extensions/hash.rb,
lib/mongoid/criteria/queryable/extentions/time.rb,
lib/mongoid/errors/invalid_elem_match_operator.rb,
lib/mongoid/errors/invalid_expression_operator.rb,
lib/mongoid/errors/invalid_transaction_nesting.rb,
lib/mongoid/railties/bson_object_id_serializer.rb,
lib/mongoid/association/nested/nested_buildable.rb,
lib/mongoid/criteria/queryable/extentions/array.rb,
lib/mongoid/criteria/queryable/extensions/range.rb,
lib/mongoid/errors/invalid_async_query_executor.rb,
lib/mongoid/association/referenced/counter_cache.rb,
lib/mongoid/association/referenced/has_one/eager.rb,
lib/mongoid/association/referenced/has_one/proxy.rb,
lib/mongoid/criteria/queryable/extensão/ objeto.rb,
lib/mongoid/criteria/queryable/extensions/regexp.rb,
lib/mongoid/criteria/queryable/extensions/string.rb,
lib/mongoid/criteria/queryable/extensions/symbol.rb,
lib/mongoid/errors/invalid_dot_dollar_assignment.rb,
lib/mongoid/association/embedded/embeds_one/proxy.rb,
lib/mongoid/association/referenced/has_many/eager.rb,
lib/mongoid/association/referenced/has_many/proxy.rb,
lib/mongoid/criteria/queryable/extensions/boolean.rb,
lib/mongoid/criteria/queryable/extentions/numeric.rb,
lib/mongoid/association/embedded/embedded_in/proxy.rb,
lib/mongoid/association/embedded/embeds_many/proxy.rb,
lib/mongoid/association/referenced/has_one/binding.rb,
lib/mongoid/config/validators/async_query_executor.rb,
lib/mongoid/errors/invalid_estimated_count_scoping.rb,
lib/rails/generators/mongoid/model/model_generator.rb,
lib/mongoid/association/embedded/embeds_one/binding.rb,
lib/mongoid/association/referenced/belongs_to/eager.rb,
lib/mongoid/association/referenced/belongs_to/proxy.rb,
lib/mongoid/association/referenced/has_many/binding.rb,
lib/mongoid/criteria/queryable/extentions/date_time.rb,
lib/mongoid/criteria/queryable/extentions/nil_class.rb,
lib/mongoid/errors/invalid_discriminator_key_target.rb,
lib/mongoid/errors/invalid_estimated_count_criteria.rb,
lib/mongoid/errors/invalid_set_polymorphic_relation.rb,
lib/mongoid/association/embedded/embedded_in/binding.rb,
lib/mongoid/association/embedded/embeds_many/binding.rb,
lib/mongoid/association/referenced/has_one/buildable.rb,
lib/mongoid/errors/in_memory_collation_not_supported.rb,
lib/mongoid/errors/too_many_nested_attribute_records.rb,
lib/rails/generators/mongoid/config/config_generator.rb,
lib/mongoid/association/embedded/embeds_one/buildable.rb,
lib/mongoid/association/referenced/belongs_to/binding.rb,
lib/mongoid/association/referenced/has_many/buildable.rb,
lib/mongoid/criteria/queryable/extentions/big_decimal.rb,
lib/mongoid/association/embedded/embedded_in/buildable.rb,
lib/mongoid/association/embedded/embeds_many/buildable.rb,
lib/mongoid/association/referenced/has_many/enumerable.rb,
lib/mongoid/errors/invalid_global_executor_concurrency.rb,
lib/mongoid/association/referenced/belongs_to/buildable.rb,
lib/mongoid/errors/nested_attributes_metadata_not_Found.rb,
lib/mongoid/criteria/queryable/extentions/time_with_zone.rb,
lib/mongoid/errors/invalid_auto_encryption_configuration.rb,
lib/mongoid/association/referenced/has_and_belongs_to_many.rb,
lib/mongoid/association/referenced/has_and_belongs_to_many/eager.rb,
lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb,
lib/mongoid/association/referenced/has_and_belongs_to_many/binding.rb,
lib/mongoid/association/referenced/has_and_belongs_to_many/buildable.rb
Visão geral
rubocop:todos
Definido sob namespace
Módulos: Associação, Atômico, Atributos, Em cache , Alterável, Clientes, CollectionConfigurable, Composable, Config, Contextual, Copiável, Deprecable, Documento, Criptografável, Igualdade, Erros, Evolvable, Extensões, Factory, Campos, Localizável, Geradores, GlobalDiscriminatorKeyAssignment , Indexável , Interceptável, Loadable, Loggable, Matchable, Matcher, Persistable, Posicional, Railties, Reloadable, Scopable, SearchIndexable, Selectable, Serializable, Shardable, Stateful, Tasks, Threaded, Timestamps, Tocável, Traversable, Utils, Validatable, Classes de avisos : AtomicUpdatePreparer, Boolean, Criteria, Deprecation, PersistenceContext, RawValue, StringifiedSymbol
Colapsode resumo constante
- PLATFORM_DATAILS =
Uma string adicionada aos detalhes da plataforma dos documentos de handshake do cliente do driver Ruby.
"mongoid-#{VERSION}".congelar
- MONGODB_VERSION =
A versão mínima suportada do MongoDB .
"2.6.0"
- Versão =
"9.0.0.alfa"
Constantes incluídas em Loadable
Carregável::DEFAULT_MODEL_PATHS
Constantes incluídas de Clientes::Sessions::ClassMethods
Clientes::Sessions::ClassMethods::CALLBACK_ACTIONS
Recolhimento do Resumo do método de instância
-
#cliente(name) ➤ Mongo::Client
Método de conveniência para obter um cliente nomeado .
-
#configure(&block) ⇒ Config
Define as opções de configuração do Mongoid.
-
#default_client ➤ Mongo::Client
Método de conveniência para obter o cliente padrão.
-
#connect_clients ➤ true
Desconecte todos os clientes ativos.
-
#persistence_context ➤ Objeto
privado
Defina o contexto de persistência que é usado quando um método de transação é chamado no módulo Mongoid.
-
#RawValue(*args) ➤ Mongoid::RawValue
Instancia um novo objeto Mongoid::RawValue.
-
#storage_options ➤ Objeto
privado
Define o cliente que é usado quando um método de transação é chamado no módulo Mongoid.
Métodos incluídos no Loggable
Métodos incluídos no Loadable
load_model, load_models, model_paths, model_paths=
Métodos incluídos de Clientes::Sessions::ClassMethods
after_commit, after_create_commit, after_destroy_commit, after_rollback, after_save_commit, after_update_commit, transaction, with_session
Métodos incluídos do GlobalDiscriminatorKeyAssignment
Métodos incluídos do Deprecable
Detalhes do método de instância
#cliente(name) ➤ Mongo::Client
Método de conveniência para obter um cliente nomeado .
109 110 111 |
# Arquivo 'lib/mongoid.rb', linha 109 def Cliente(name) Clientes.with_name(name) end |
#configurar(&block) ➤ Config
Define as opções de configuração do Mongoid. Melhor usado passando um bloco.
77 78 79 80 81 |
# Arquivo 'lib/mongoid.rb', linha 77 def configure(&noum: bloco ; verb: bloquear) Método Config a menos que block_given? noum: bloco ; verb: bloquear.aridade == 0 ? Config.instance_exec(&noum: bloco ; verb: bloquear) : rendimento(Config) end |
#default_client ➤ Mongo::Client
Método de conveniência para obter o cliente padrão.
89 90 91 |
# Arquivo 'lib/mongoid.rb', linha 89 def default_client Clientes.default end |
#connect_clients ➤ true
Desconecte todos os clientes ativos.
99 100 101 |
# Arquivo 'lib/mongoid.rb', linha 99 def connect_clients Clientes.Desconectar end |
#persistence_context ➤ Objeto
Este método faz parte de uma API privada. Evite usar esse método, se possível, pois ele pode ser removido ou alterado no futuro.
Defina o contexto de persistência que é usado quando um método de transação é chamado no módulo Mongoid.
124 125 126 |
# Arquivo 'lib/mongoid.rb', linha 124 def persistence_context PersistenceContext.obter(Mongoid) || PersistenceContext.Novo(Mongoid) end |
#RawValue(*args) ➤ Mongoid::RawValue
Instancia um novo objeto Mongoid::RawValue. Usado como um atalho de sintaxe .
13 14 15 |
# Arquivo 'lib/mongoid/extensions/raw_value.rb', linha 13 def Valor bruto(*Args) Valor bruto.Novo(*Args) end |
#storage_options ➤ Objeto
Este método faz parte de uma API privada. Evite usar esse método, se possível, pois ele pode ser removido ou alterado no futuro.
Define o cliente que é usado quando um método de transação é chamado no módulo Mongoid. Este DEVE ser o cliente padrão .
132 133 134 |
# Arquivo 'lib/mongoid.rb', linha 132 def { cliente: :default } end |