From 0573ee4195d98a9372327e7c103190c3ae69967c Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 24 Jan 2025 15:01:29 -0500 Subject: [PATCH 1/5] DOCSP-42730: landing page --- source/index.txt | 80 +++++++++++-- source/integrations-tools.txt | 4 + .../legacy-files/collection-configuration.txt | 107 ------------------ source/security.txt | 3 +- 4 files changed, 78 insertions(+), 116 deletions(-) delete mode 100644 source/legacy-files/collection-configuration.txt diff --git a/source/index.txt b/source/index.txt index 4a4cfe64..0915200c 100644 --- a/source/index.txt +++ b/source/index.txt @@ -1,14 +1,10 @@ +.. _mongoid-odm-landing: .. _mongoid-odm: ======= {+odm+} ======= -{+odm+} is the officially supported object-document mapper (ODM) for -MongoDB in Ruby. To work with {+odm+} from the command line using -``rails``-like tooling, you can use the `railsmdb -`_ utility. - .. toctree:: :titlesonly: @@ -20,8 +16,76 @@ MongoDB in Ruby. To work with {+odm+} from the command line using Secure Your Data Integrations & Tools API Documentation - What's New Compatibility + What's New Issues & Help - /additional-resources - /ecosystem + View the Source + +Introduction +------------ + +Welcome to the documentation site for {+odm+}. {+odm+} is the officially +supported object-document mapper (ODM) for MongoDB in {+language+}. + +You can add {+odm+} to your application to connect your {+language+} to +MongoDB. Install it by adding it to your project's ``Gemfile`` file or +set up a runnable project by following one of the Quick Start guides. + +Quick Start +----------- + +Learn how to establish a connection to MongoDB Atlas and begin +working with data by following one of the following guides: + +- :ref:`mongoid-quick-start-rails` +- :ref:`mongoid-quick-start-sinatra` + +Configuration +------------- + +To learn how to configure different options in your {+odm+} application, +see the :ref:`mongoid-configuration` section. + +Interact with Data +------------------ + +To learn how to use {+odm+} to interact with your MongoDB data, +see the :ref:`mongoid-interact-data` section. + +Model Your Data +--------------- + +To learn how to model your MongoDB data as {+odm+} models, +see the :ref:`mongoid-data-modeling` section. + +Secure Your Data +---------------- + +To learn how to secure your data by using encryption, +see the :ref:`mongoid-security` section. + +Integrations & Tools +-------------------- + +To learn how to add {+odm+} to an existing application, +see the :ref:`mongoid-integrations-tools` section. This section also +includes information about the Rails framework and other resources. + +Compatibility +------------- + +To learn about the versions of the MongoDB Server, {+language+} +language, {+ruby-driver+}, and Rails that are compatible with each +version of {+odm+}, see :ref:`mongoid-compatibility`. + +What's New +---------- + +To view a list of new features and changes in each version, see the +:ref:`mongoid-whats-new` section. + +Issues & Help +------------- + +To find resources for troubleshooting and to learn about contributing to +{+odm+}, see :ref:`mongoid-issues-and-help`. diff --git a/source/integrations-tools.txt b/source/integrations-tools.txt index 0e5110db..827cdb3c 100644 --- a/source/integrations-tools.txt +++ b/source/integrations-tools.txt @@ -17,3 +17,7 @@ Integrations & Tools Add {+odm+} to an Existing Application Rails Integration External Resources + +- :ref:`mongoid-add-to-existing` +- :ref:`mongoid-rails-integration` +- :ref:`mongoid-external-resources` diff --git a/source/legacy-files/collection-configuration.txt b/source/legacy-files/collection-configuration.txt deleted file mode 100644 index 26bea016..00000000 --- a/source/legacy-files/collection-configuration.txt +++ /dev/null @@ -1,107 +0,0 @@ -.. _collection_configuration: - -************************ -Collection Configuration -************************ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -Configuring a Document Collection -================================= - -You can specify collection options for documents using the ``store_in`` macro. -This macro accepts ``:collection_options`` argument, which can contain any collection -options that are supported by the driver. - -.. note:: - - In order to apply the options, the collection must be explicitly created up-front. - This should be done using :ref:`Collection Management Rake Task`. - -Please refer to `the driver collections page -`_ -for the more information about collection options. - -.. note:: - - Collection options depend on the driver version and MongoDB server version. - It is possible that some options, like time series collections, are not available - on older server versions. - -Time Series Collection ----------------------- - -.. code-block:: ruby - - class Measurement - include Mongoid::Document - - field :temperature, type: Integer - field :timestamp, type: Time - - store_in collection_options: { - time_series: { - timeField: "timestamp", - granularity: "minutes" - }, - expire_after: 604800 - } - end - - - -Capped Collections ------------------- - -.. code-block:: ruby - - class Name - include Mongoid::Document - - store_in collection_options: { - capped: true, - size: 1024 - } - end - -Set a Default Collation on a Collection ---------------------------------------- - -.. code-block:: ruby - - class Name - include Mongoid::Document - - store_in collection_options: { - collation: { - locale: 'fr' - } - } - end - -.. _collection-management-task: - -Collection Management Rake Task -=============================== - -If you specify collection options for a document, then the corresponding collection -must be explicitly created prior to use. To do so, use the provided -``db:mongoid:create_collections`` Rake task: - -.. code-block:: bash - - $ rake db:mongoid:create_collections - -The create collections command also works for just one model by running -in Rails console: - -.. code-block:: ruby - - # Create collection for Model - Model.create_collection diff --git a/source/security.txt b/source/security.txt index 3b8db0b6..9e2470f2 100644 --- a/source/security.txt +++ b/source/security.txt @@ -18,4 +18,5 @@ Secure Your Data In this section, you can learn how to secure your data when using {+odm+}. -- :ref:`Client-Side Field Level Encryption ` Learn how to encrypt your data with {+odm+}. \ No newline at end of file +- :ref:`Client-Side Field Level Encryption ` Learn + how to encrypt your data with {+odm+}. From a4f2b9bc4b358c57ee1233c776f42a66189d7d00 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 24 Jan 2025 16:34:27 -0500 Subject: [PATCH 2/5] MW PR fixes 1 --- snooty.toml | 4 +--- source/index.txt | 15 ++++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/snooty.toml b/snooty.toml index 02e25f34..35af2fcd 100644 --- a/snooty.toml +++ b/snooty.toml @@ -12,10 +12,7 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" toc_landing_pages = [ "/quick-start-rails", "/quick-start-sinatra", - "/interact-data", "/interact-data/specify-query", - "/data-modeling", - "/configuration", "/issues-and-help" ] @@ -35,3 +32,4 @@ api = "https://www.mongodb.com/docs/mongoid/current/api" ruby-api = "https://www.mongodb.com/docs/ruby-driver/current/api" active-record-docs = "https://guides.rubyonrails.org" shared-library = "Automatic Encryption Shared Library" +mdb-server = "MongoDB Server" diff --git a/source/index.txt b/source/index.txt index 0915200c..753af244 100644 --- a/source/index.txt +++ b/source/index.txt @@ -27,9 +27,10 @@ Introduction Welcome to the documentation site for {+odm+}. {+odm+} is the officially supported object-document mapper (ODM) for MongoDB in {+language+}. -You can add {+odm+} to your application to connect your {+language+} to -MongoDB. Install it by adding it to your project's ``Gemfile`` file or -set up a runnable project by following one of the Quick Start guides. +You can add {+odm+} to your application to connect your {+language+} +application to MongoDB. You can install {+odm+} by adding it to your project's +``Gemfile`` or set up a runnable project by following one of the +Quick Start guides. Quick Start ----------- @@ -69,14 +70,14 @@ Integrations & Tools To learn how to add {+odm+} to an existing application, see the :ref:`mongoid-integrations-tools` section. This section also -includes information about the Rails framework and other resources. +includes information about the {+ror+} framework and other resources. Compatibility ------------- -To learn about the versions of the MongoDB Server, {+language+} -language, {+ruby-driver+}, and Rails that are compatible with each -version of {+odm+}, see :ref:`mongoid-compatibility`. +To learn about the versions of the {+mdb-server+}, the {+language+} +language, the {+ruby-driver+}, and {+ror+} framework that are compatible +with each version of {+odm+}, see :ref:`mongoid-compatibility`. What's New ---------- From 4cc69dcb81e53492c1451d7a8279d3219235223d Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 24 Jan 2025 16:37:14 -0500 Subject: [PATCH 3/5] small fix --- source/interact-data.txt | 4 ++++ source/{ => interact-data}/aggregation.txt | 0 2 files changed, 4 insertions(+) rename source/{ => interact-data}/aggregation.txt (100%) diff --git a/source/interact-data.txt b/source/interact-data.txt index f211ae5d..3ab217ab 100644 --- a/source/interact-data.txt +++ b/source/interact-data.txt @@ -17,6 +17,7 @@ Interact with Data Perform Data Operations Specify a Query Modify Query Results + Aggregation Search Text Transactions and Sessions Nested Attributes @@ -33,6 +34,9 @@ MongoDB data. - :ref:`mongoid-data-modify-results`: Learn how to modify the way that {+odm+} returns results from queries. +- :ref:`mongoid-aggregation`: Learn how to transform your data by using + MongoDB aggregation. + - :ref:`mongoid-data-text-search`: Learn how to perform efficient searches on text fields. diff --git a/source/aggregation.txt b/source/interact-data/aggregation.txt similarity index 100% rename from source/aggregation.txt rename to source/interact-data/aggregation.txt From bd3588f9f319d575c6f521762663d94ce8877a56 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 24 Jan 2025 16:38:51 -0500 Subject: [PATCH 4/5] small fix --- source/index.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/index.txt b/source/index.txt index 753af244..177adff2 100644 --- a/source/index.txt +++ b/source/index.txt @@ -25,10 +25,12 @@ Introduction ------------ Welcome to the documentation site for {+odm+}. {+odm+} is the officially -supported object-document mapper (ODM) for MongoDB in {+language+}. +supported object-document mapper (ODM) for MongoDB in {+language+}. By +using {+odm+}, you can easily interact with your data and create +flexible data models native to {+language+} applications. -You can add {+odm+} to your application to connect your {+language+} -application to MongoDB. You can install {+odm+} by adding it to your project's +You can add {+odm+} to your {+language+} application to connect it to +a MongoDB database. You can install {+odm+} by adding it to your project's ``Gemfile`` or set up a runnable project by following one of the Quick Start guides. From 6504ee79110d9f5cf019a2c4428358a4b174fe67 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 24 Jan 2025 16:39:42 -0500 Subject: [PATCH 5/5] small fix --- source/index.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.txt b/source/index.txt index 177adff2..3ed8ed5d 100644 --- a/source/index.txt +++ b/source/index.txt @@ -30,7 +30,7 @@ using {+odm+}, you can easily interact with your data and create flexible data models native to {+language+} applications. You can add {+odm+} to your {+language+} application to connect it to -a MongoDB database. You can install {+odm+} by adding it to your project's +a MongoDB database. Install {+odm+} by adding it to your project's ``Gemfile`` or set up a runnable project by following one of the Quick Start guides.