diff --git a/snooty.toml b/snooty.toml index 02e25f3..35af2fc 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 4a4cfe6..3ed8ed5 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,79 @@ 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+}. 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 {+language+} application to connect it to +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. + +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 {+ror+} framework and other resources. + +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 +---------- + +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 0e5110d..827cdb3 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/interact-data.txt b/source/interact-data.txt index f211ae5..3ab217a 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 diff --git a/source/legacy-files/collection-configuration.txt b/source/legacy-files/collection-configuration.txt deleted file mode 100644 index 26bea01..0000000 --- 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 3b8db0b..9e2470f 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+}.