Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONGOID-5370 Add collection options support #5452

Merged
merged 21 commits into from
Sep 5, 2022

Conversation

comandeo
Copy link
Contributor

@comandeo comandeo commented Aug 22, 2022

This PR solves https://jira.mongodb.org/browse/MONGOID-5370 by providing a mechanism to specify any collection options for a Mongoid document. It means that a user still have to use the driver's documentation to find out how to set up a time series collection or a capped collection. It also means that Mongoid won't validate options that user provided, and will rely on the driver's errors.

On the other hand, with this PR it is not necessary to use the driver directly, all the configuration can be done using store_in macro and a rake task. So, I believe this is still an improvement.

@comandeo comandeo marked this pull request as ready for review August 23, 2022 08:45
@comandeo comandeo requested review from Neilshweky and p-mongo and removed request for Neilshweky August 23, 2022 08:45
@johnnyshields
Copy link
Contributor

johnnyshields commented Aug 23, 2022

This is definitely useful (vs. current approach = having to use driver)

Should look here if there are more options that can be supported: https://www.mongodb.com/docs/v6.0/reference/method/db.createCollection/#mongodb-method-db.createCollection

@comandeo comandeo requested review from p-mongo and Neilshweky and removed request for p-mongo and Neilshweky August 26, 2022 08:36
Copy link
Contributor

@p-mongo p-mongo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I typed this up yesterday and I think I will need to do another pass but I'll submit this for now.

docs/reference/collection-configuration.txt Outdated Show resolved Hide resolved
lib/mongoid/collection_configurable.rb Outdated Show resolved Hide resolved
lib/mongoid/errors/create_collection.rb Outdated Show resolved Hide resolved
lib/mongoid/tasks/database.rb Show resolved Hide resolved
docs/reference/collection-configuration.txt Outdated Show resolved Hide resolved
docs/reference/collection-configuration.txt Outdated Show resolved Hide resolved
docs/reference/collection-configuration.txt Show resolved Hide resolved
docs/reference/collection-configuration.txt Outdated Show resolved Hide resolved
docs/reference/collection-configuration.txt Outdated Show resolved Hide resolved
lib/config/locales/en.yml Outdated Show resolved Hide resolved
lib/mongoid/collection_configurable.rb Outdated Show resolved Hide resolved

module ClassMethods
def create_collection
if coll_options = collection.database.list_collections(filter: { name: collection_name.to_s }).first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that this method (and thus rake task) doesn't create collections that don't have collection options specified needs to be documented. I think it's better to create all collections always? @Neilshweky

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of creating all collections regardless of store_in macro, it seems to be more intuitive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree. Although, I don't see how that's true... It seems from the code here that collections are always created, regardless of whether or not there are collection options, did this change recently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the code after I got @p-mongo comment, now it always creates collections.

logger.info(
"MONGOID: Collection '#{collection_name}' already exist " +
"in database '#{database_name}' with options '#{coll_options}'."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think I would prefer this method to 1) retrieve collection options and 2) raise if they are different from current specification instead of succeeding in that case but leaving db in a state different from what one might expect. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be ideal; however, implementing this adds some knowledge about the driver and collection options to Mongoid. When we create time series collection, we pass options using time_series key. When we get collection information using listCollections, the key is timeseries. Same with expire_after and expireAfterSeconds, clustered_index and clusteredIndex, and so on - https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/collection.rb#L68

Further, if you do not specify, for example, granularity for a time series collection, it will be defaulted to seconds. However, what if a collection was created with with granularity = hours, but the corresponding Mongoid model omits the granularity option? Should we also validate defaults (=> adding even more knowledge about driver/server implementation details to the Mongoid)? Without such validation we cannot guarantee the state of db.

The above can be done in Mongoid, but we need to agree on it. I believe we usually avoid adding such low level details.

Copy link
Contributor

@johnnyshields johnnyshields Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would propose that we should only check for conflicts in cases where values have been explicitly set by the user in Mongoid on the store_in macro, i.e. not validate vs Mongoid's defaults.

Also, when do validations actually happen? i.e. once per model per process lifetime, the first time the model is used in any query? it might be good to have a rake task to run all validations, e.g. before release etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnnyshields In the proposed implementation if we add validations to the db:mongoid:create_collections task, it can be run as often as possible. It does not modify existing collections; so, it would be possible to execute it as a deployment step.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, retrieving collection options and munching them is not something I think belongs in this PR.

I tested and collection cannot be created twice with identical options:

irb(main):006:0> a['foo1',capped:true,size:2].create
=> #<Mongo::Operation::Result:0x2660 documents=[{"ok"=>1.0}]>
irb(main):007:0> a['foo1',capped:true,size:2].create
/home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/result.rb:364:in `raise_operation_failure': [48:NamespaceExists]: Collection already exists. NS: admin.foo1 (on localhost:14400) (Mongo::Error::OperationFailure)
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/result.rb:330:in `validate!'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:36:in `block (3 levels) in validate_result'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:108:in `add_server_diagnostics'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:35:in `block (2 levels) in validate_result'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:54:in `add_error_labels'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:34:in `block in validate_result'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:94:in `unpin_maybe'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/response_handling.rb:33:in `validate_result'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/executable.rb:81:in `block in execute'
	from <internal:kernel>:90:in `tap'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/executable.rb:80:in `execute'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/polymorphic_operation.rb:50:in `execute_with_connection'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/polymorphic_operation.rb:36:in `block in execute'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/server/connection_pool.rb:667:in `with_connection'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/server.rb:448:in `with_connection'
	from /home/w/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/mongo-2.18.1/lib/mongo/operation/shared/polymorphic_operation.rb:35:in `execute'
	... 9 levels...
irb(main):008:0> 

How about:

Model.create_collection creates the collection if it does not exist
Model.create_collection! attempts to create the collection every time, will fail if collection exists

  • have two rake tasks, maybe mongoid:create_collections and mongoid:create_collections:force or something like that.

@Neilshweky

Copy link
Contributor

@johnnyshields johnnyshields Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should bear in mind users are lazy creatures, and most will not remember to run a Rake task to create collections. Today everyone is used having it happen automatically when the first model instance is persisted at runtime. The Rake task is useful as a power tool perhaps, but should not be the golden path.

Perhaps the first time a given collection is accessed in a process, Mongoid could soft-validate that the collection's options match what is actually in the DB, and output a warning log line saying "either revert the options or make a new collection" (AFAIK collections can't be reconfigured.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(AFAIK collections can't be reconfigured.)

There is a collmod command, which, I believe, can modify some collection options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm struggling with the whole idea of doing this as a rake task. To me, if I put in collection options into code (i.e. as opposed to a config file), I'm expecting that to be used on collection creation no matter what. I understand this is difficult because the best possible implementation requires an incredible amount of detail with respect to server options, but I'm wondering if it's possible to create the collection on normal collection creation if the model hasn't been created yet? (and not warn if it has.)

Now, if we decide that we for sure would rather a rake task, I think there are a few things to consider:

  1. first, I think the force terminology is a bit dangerous, since it conflicts with Rails' force. On Rails' create_table method, the force option will cause the table to be dropped and recreated every time.
  2. We could make three different rake tasks:
  • mongoid:create_collections- warn on collection already exists
  • mongoid:create_collections:validate- error on collection already exists (open to different names)
  • mongoid:create_collections:force- Drops the collection and creates a new one.
  1. Now this doesn't mean we need 3 methods, I think we would be better off having one method with different options. I think in Mongoid we often use the ! to mean "will raise an error" whereas this is inconsistent with Ruby's meaning, as Ruby uses the bang to mean that the method will modify the caller.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mongoid:create_collections:force in the Rails sense would be useful for development. The mongoid:create_collections:validate I think is impractical - it would always fail in production and in development on a non-empty database, for the empty database in development mongoid:create_collections:force would work just as well. The mongoid:create_collections with warning behavior I think could be useful in production and would be the equivalent to Rails' migrations, alternatively it could perhaps be renamed to mongoid:create_collections:missing and not warn about the existing ones.

For indexes we have precedent of checking indexes in db vs indexes declared in models, this is also non-trivial and from what I remember doesn't quite work 100% of the time.


db.createCollection("name", { collation: { locale: 'fr' } });
# Create collection for Model
Model.create_collections
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this is the same as Model.collection.create isn't it? The only difference is the exception raised will be a Mongoid::MongoidError-derived one, and this was your intention?

I think the method should be singular (Model.create_collection) since there can't be many right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method name is singular, good catch.

Model.collection.create does not consider collection_options set by store_in macro. The intention is to promote using store_in macro for collection options, instead of using driver.

extend ActiveSupport::Concern

module ClassMethods
# Create collection for the Mongoid document this module is included into.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should write docstrings with respect to how the users will use them, and not how they're used in the codebase?

I think I would rather something like "Create the collection for the called upon Mongoid model" or something like that, and not talk about how its included into modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated according to the suggestion.


module ClassMethods
def create_collection
if coll_options = collection.database.list_collections(filter: { name: collection_name.to_s }).first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree. Although, I don't see how that's true... It seems from the code here that collections are always created, regardless of whether or not there are collection options, did this change recently?

logger.info(
"MONGOID: Collection '#{collection_name}' already exist " +
"in database '#{database_name}' with options '#{coll_options}'."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(AFAIK collections can't be reconfigured.)

There is a collmod command, which, I believe, can modify some collection options.

logger.info(
"MONGOID: Collection '#{collection_name}' already exist " +
"in database '#{database_name}' with options '#{coll_options}'."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm struggling with the whole idea of doing this as a rake task. To me, if I put in collection options into code (i.e. as opposed to a config file), I'm expecting that to be used on collection creation no matter what. I understand this is difficult because the best possible implementation requires an incredible amount of detail with respect to server options, but I'm wondering if it's possible to create the collection on normal collection creation if the model hasn't been created yet? (and not warn if it has.)

Now, if we decide that we for sure would rather a rake task, I think there are a few things to consider:

  1. first, I think the force terminology is a bit dangerous, since it conflicts with Rails' force. On Rails' create_table method, the force option will cause the table to be dropped and recreated every time.
  2. We could make three different rake tasks:
  • mongoid:create_collections- warn on collection already exists
  • mongoid:create_collections:validate- error on collection already exists (open to different names)
  • mongoid:create_collections:force- Drops the collection and creates a new one.
  1. Now this doesn't mean we need 3 methods, I think we would be better off having one method with different options. I think in Mongoid we often use the ! to mean "will raise an error" whereas this is inconsistent with Ruby's meaning, as Ruby uses the bang to mean that the method will modify the caller.


require "spec_helper"

class CollectionConfigurableCapped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be defined in a before(:all) block, and call remove_const on them in an after(:all)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. Done.

CollectionConfigurableCapped
end

it 'creates the collection' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add an it that calls collstats and makes sure the options were actually set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should have the driver functionality here, but some additional coverage won't hurt. Added the requested.

.and_raise(Mongo::Error::OperationFailure)
end

it 'raises an error' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this raise an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the we the expect_any_instance_of above. It the driver raises an error, Mongoid should, too.
However, I can see why this test might seem unclear, I reworked it.

@@ -0,0 +1,13 @@
module DatabaseSpec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe name this file database_spec_models.rb for consistency with the rest of the codebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. Updated.

store_in collection: "measurement",
collection_options: {
capped: true, size: 10000
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test for time series options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I do not think we should test all the possible options in Mongoid. I use capped collection options because they are accepted by most server versions.

Mongoid::Tasks::Database.create_collections(models)
end
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add tests when called on embedded (cyclic and non cyclic) collections.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# @param [ true | false ] force If true, the method will drop existing
# collections before creating new ones. If false, the method will create
# only new collection (that do not exist in the database).
def create_collections(models = ::Mongoid.models, force: false)
Copy link
Contributor

@johnnyshields johnnyshields Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this variable to :drop_existing_collections. The name :force is not 100% clear that it will drop your collections, and given the potential severity of a mistake here, we should be 100% clear.

Copy link
Contributor Author

@comandeo comandeo Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar method in ActiveRecord they uses force, hence force here. I would leave it as it is now.

However, I agree that drop_existing_collections might be more explicit. @p-mongo @Neilshweky what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior is clearly described and matches Rails behavior. I don't see the need to change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Rails is using force then OK.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of the cartoon is exactly opposite of what you are requesting @johnnyshields .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just think about this cartoon every time I hear dropping tables.

@comandeo comandeo merged commit 7f6fd08 into mongodb:master Sep 5, 2022
@comandeo comandeo deleted the 5370-time-series-collections branch September 5, 2022 07:27
comandeo pushed a commit that referenced this pull request Sep 5, 2022
jamis added a commit that referenced this pull request Mar 14, 2023
…) to master (#5561)

* MONGOID-5334 ensure localized demongoization works with symbol keys (#5416)

* MONGOID-5334 ensure localized demongoization works with symbol keys

* MONGOID-5334 add type check

* MONGOID-5334 change back type check

* MONGOID-5437 extract fallback enabling logic into macro (#5428)

* MONGOID-5438 initial changes from Johnny's PR

* MONGOID-5438 additional changes from johnny's
PR

* MONGOID-5437 fix tests

* MONGOID-5437 fix uniqueness test

* MONGOID-5334 enforce Hash type in localized demongoize (#5430)

* MONGOID-5334 add type check

* MONGOID-5334 change back type check

* MONGOID-5334 enforce Hash type in localized demongoize

* MONGOID-5456 cast castable values for integer/float/big decimal (#5431)

* MONGOID-5456 cast castable values for integer/float/big decimal

* MONGOID-5456 assert duration

* MONGOID-4403 Support Dirty Tracking changed from/to (#5432)

* MONGOID-4403 Support Dirty Tracking changed from/to

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-4403 add false example

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5456 Add documentation for responding to to_* (#5434)

* MONGOID-5456 Add documentation for responding to to_*

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5461 Change custom field options example (#5438)

* MONGOID-5461 Change custom field options example

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5458 Document fallbacks option on localized fields (#5439)

* MONGOID-5460 Update custom field type protocol documentation (#5441)

* MONGOID-5457 Document + example of non-String field types in localized fields (#5444)

* MONGOID-4698 update warning when overriding criteria methods in scope (#5442)

* MONGOID-4698 update warning when overriding criteria methods in scope

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5417 Fix memory leak when call 'with' (#5409)

* MONGOID-4528 Add more dirty methods (#5440)

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-4698 Correct warning to point out that klass.band doesnt conflict (#5450)

* MONGOID-5226 Allow setting "store_in collection" on document subclass (#5449)

* MONGOID-5226 Allow setting "store_in collection" on document subclass

* remove comment

* MONGOID-5226 add docs and testing

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5226 answer comments

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5293 put legacy_attributes in 7.5 defaults (#5425)

* MONGOID-5293 put legacy_attributes in 7.5

* switch order

* MONGOID-5293 fix defaults tests

* MONGOID-5438 Implement local override for i18n parameters (#5427)

* MONGOID-5438 Implement local override for i18n parameters

* MONGOID-5438 get rid of enfore_available_locale changes

* MONGOID-5438 get rid of before alls

* MONGOID-5438 fix tests caused by rspec precedence

* MONGOID-5438 attempt to fix tests when fallbacks disabled

* MONGOID-5438 make fallbacks default to return [self]

* MONGOID-5438 reset fallbacks

* MONGOID-5438 attempt to fix tests

* MONGOID-5438 retry_test

* MONGOID-5438 undefine fallback methods after fallback tests

* MONGOID-5438 add back defaults

* MONGOID-5438 use new macros

* MONGOID-5438 use before and after suite

* MONGOID-5438 update mrss

* MONGOID-5438 remove suite checks

* MONGOID-5370 Add collection options support (#5452)

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5474 add readonly! and raise on save/update (#5455)

* MONGOID-5474 add readonly! and raise on save/update

* MONGOID-5474 flip flag for 9.0 and add default

* MONGOID-5474 fix error tests

* Update spec/mongoid/config_spec.rb

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

* Update lib/mongoid/config.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5474/MONGOID-5478 add docs and release notes (#5457)

* MONGOID-5474 add docs and release notes

* MONGOID-5474 use read-only

* MONGOID-5474 add configuration docs

* MOGOID-5474 switch order of flag docs

* add MONGOID-5477 use case

* MONGOID-5477 / MONGOID-5474 / MONGOID-5478 add user test (#5459)

* MONGOID-5474 add user test

* MONGOID-5474 change to read-only

* MOGOID-5474 switch order of flag docs

* MONGOID-5476 update 8.1 installation version (#5464)

* MONGOID-5474 flip the feature flag in 8.1 (#5456)

* MONGOID-5474 flip the feature flag in 8.1

* MONGOID-5474 flip flag in configuration

* MONGOID-5474 update config test

* MONGOID-5227 Add test and adjust docs for dotted attribute assignment in default scope (#5474)

* MONGOID-5227 Add test and adjust docs for dotted attribute assignment in default scope

* MONGOID-5227 adjust docs

* MONGOID-5227 clarify the docs and add tests

* Update docs/reference/queries.txt

Co-authored-by: Oleg Pudeyev <[email protected]>

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5493: Update Gem::Specification team info (#5476)

* MONGOID-5312 Document attributes method in reference (#5477)

* MONGOID-5312 Document attributes method in reference

* Apply suggestions from code review

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5312 update languagw

Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5082 Create contributing guidelines (#5472)

* MONGOID-5082 Create contributing guidelines

* MONGOID-5082 propose test coverage

* MONGOID-5082 whitespace

* MONGOID-5082 update language

* add intro

* MONGOID-5445 Add load_async to criteria (#5454)

Co-authored-by: Neil Shweky <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>

* MONGOID-5291 Clarify whether :touch option is applicable for all updates (#5481)

* MONGOID-5261 Use config_override when a test requires a certain configuration option value (#5479)

* MONGOID-5261 Use config_override when a test requires a certain configuration option value

* fix syntax error

* MONGOID-5261 a little more cleanup

* MONGOID-5261 more cleanup

* more clean up

* MONGOID-5261 add persistence context override

* MONGOID-5261 add comment

* MONGOID-5100 allow selector arguments for .exists? (#5466)

* MONGOID-5100 allow selector arguments for .exists?

* MONGOID-5100 add examples to the docstrings

* MONGOID-5100 add docs and release notes

* Empty-Commit

* MONGOID-5100 allow false to be passed

* MONGOID-5100 update docs and docstrings

* MONGOID-5100 remove false as a param

* MONGOID-5100 put back nil/false

* MONGOID-5100 fix memory tests and fix limit == 0

* MONGOID-5262 Implement local time zone override for tests (#5480)

* MONGOID-5506 Update 8.x docs to document unscoped behavior changing in 9.0 (#5483)

* MONGOID-5506 Update 8.x docs to document unscoped behavior changing in 9.0

* Update lib/mongoid/scopable.rb

* RUBY-2942: Update documentation links (#5482)

* MONGOID-5363 Change #upsert to perform updating upsert rather than replacing upsert (#5492)

* MONGOID-5363 add :replace option to upsert method

* MONGOID-5363 add docs, release notes for 8.1/9.0

* MONGOID-5363 switch default in 8.1 (#5493)

* MONGOID-5363 update docstrings, flag default, and tests for 8.1

* specify default in mongoid 9

* MONGOID-5331 Document hash assignment to associations (#5494)

* MONGOID-5331 change buildable docs

* MONGOID-5331 add proxy tests and fix embedded_in proxy

* MONGOID-5331 update models

* Update spec/mongoid/association/embedded/embedded_in/proxy_spec.rb

* MONGOID-5331 update doc strings in batchable

* MONGOID-5331 add docs

* MONGOID-5331 add docs/release notes

* Apply suggestions from code review

* Update spec/mongoid/association/embedded/embedded_in/proxy_spec.rb

* RUBY-3097 add/use monotonic time for deadlines (#5491)

* RUBY-3097 add/use monotonic time for deadlines

* remove license and fix tests

* MONGOID-3834 Document association availability in custom getters and setters (#5503)

* MONGOID-3834 Document association availability in custom getters and setters

* add callbacks note

* MONGOID-5496: Update Getting Started (Rails) tutorial for Rails 7 (#5509)

* Clone Rails Tutorial and create variation for Rails 7

* Update Existing Application docs for Rails 7

* MONGOID-5532: Fix path to comments partial (#5511)

* MONGOID-5533: Unnecessary edits to Comment model in Rails Getting Started (#5512)

* Add note about workaround for MONGOID-4885 in Rails 6 docs

* Fix whitespace

* MONGOID-5521 migrate Mongoid docs to snooty (#5513)

* fix code blocks

* MONGOID-5521 fix all parse errors

* build docs with github action

* Revert "build docs with github action"

This reverts commit 9ffda44.

* MONGOID-5496: Update Rails 7 Tutorial (#5515)

* Remove `--skip-bundle` from _Optionally Skip Tests_ section

* MONGOID-5518: Add Puma dependency to Sinatra tutorial (#5516)

* MONGOID-5453 Add .none_of query method (#5524)

* "none_of" query method

* update docs and release notes

* fix underline for header

* MONGOID-5539: Fix example in aggregation reference documentation (#5536)

* Update aggregation.txt

* Update aggregation.txt

* MONGOID-5228 disallow _id to be updated on persisted documents (ported to 8.1-stable) (#5545)

* port #5542 to 8.1-stable

* test tweak

* update 8.1 release notes to mention immutable_ids

* MONGOID-5490: Deprecate :use_activesupport_time_zone (#5488)

* Deprecate the use_activesupport_time_zone_deprecated config option.

* Typo

* Update config.rb

* Update mongoid-8.1.txt

---------

Co-authored-by: shields <[email protected]>

* MONGOID-5509: Deprecate all feature flags which were introduced in Mongoid 7.x (#5489)

* Deprecate the use_activesupport_time_zone_deprecated config option.

* Typo

* Mongoid 8.1 should deprecate all feature flags which were introduced in the 7.x series, with intent to remove them in Mongoid 9.0.

---------

Co-authored-by: shields <[email protected]>

* Remove :use_activesupport_time_zone option + improve readme around timezone usage given the change

* Remove deprecated :broken_aggregables config option

* Remove deprecated :broken_alias_handling config option

* Remove deprecated :broken_and config option

* Remove deprecated :broken_scoping config option

* Remove deprecated :broken_updates config option

* Remove deprecated :compare_time_by_ms config option

* Remove deprecated :legacy_attributes config option

* Remove deprecated :legacy_pluck_distinct config option

* Remove deprecated :legacy_triple_equals config option

* Remove deprecated :object_id_as_json_oid config option

* Remove deprecated :overwrite_chained_operators config option

* Drop support for config.load_defaults versions "7.3", "7.4", "7.5", as their options are no longer available.

* Fix broken spec in Mongoid 8.1

---------

Co-authored-by: Neil Shweky <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>
Co-authored-by: Dmitry Rybakov <[email protected]>
Co-authored-by: Alex Bevilacqua <[email protected]>
Co-authored-by: Jamis Buck <[email protected]>
Co-authored-by: Jamis Buck <[email protected]>
Co-authored-by: shields <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants