Skip to content

DOCSP-46327: Create indexes #8

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

Merged
merged 9 commits into from
Jan 28, 2025

Conversation

norareidy
Copy link
Collaborator

@norareidy norareidy commented Jan 17, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-46327

Staging Links

  • model-data/indexes
  • model-data
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?

    Copy link

    netlify bot commented Jan 17, 2025

    Deploy Preview for docs-django ready!

    Name Link
    🔨 Latest commit 519a551
    🔍 Latest deploy log https://app.netlify.com/sites/docs-django/deploys/6798fa267fe5a400083ea7b2
    😎 Deploy Preview https://deploy-preview-8--docs-django.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    Copy link
    Collaborator

    @aclark4life aclark4life left a comment

    Choose a reason for hiding this comment

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

    LGTM pending db_table clarification

    Copy link
    Contributor

    @mcmorisi mcmorisi left a comment

    Choose a reason for hiding this comment

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

    LGTM with a few questions!

    Comment on lines +34 to +35
    index on your model. {+django-odm+} creates the same index on your
    MongoDB collection that the model represents.
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Q: First time reviewing docs in this repo, should we call it "Django MongoDB Backend" or "the Django MongoDB Backend"?

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    I've been calling it just "Django MongoDB Backend" based on api docs / source code wording

    Comment on lines +125 to +132
    Alternatively, you can set the ``db_index`` option on your model's ``title`` field
    to create the index, as shown in the following code:

    .. literalinclude:: /includes/model-data/indexes.py
    :start-after: start-single-field-option
    :end-before: end-single-field-option
    :language: python
    :copyable:
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The sample looks like just assigning a value to a variable named title with no clear relation to the Recipe model – just wanted to be clear that Python/Django works this way and we're not missing any extra lines/code here.

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    I added "class Recipe(models.Model):" to the code example, just so it's clear that this is a Recipe field

    - :manual:`Single Field Indexes </core/index-single/>`
    - :manual:`Compound Indexes </core/index-compound/>`
    - :manual:`Multikey Indexes </core/index-multikey/>`
    - :manual:`Embedded Document Indexes </core/index-single/create-embedded-object-index/>`
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Broken link

    Copy link
    Collaborator

    @R-shubham R-shubham left a comment

    Choose a reason for hiding this comment

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

    LGTM

    @norareidy norareidy merged commit 3e4fd5c into mongodb:master Jan 28, 2025
    5 checks passed
    @norareidy norareidy deleted the DOCSP-46327-create-index branch January 28, 2025 15:50
    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.

    4 participants