-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
✅ Deploy Preview for docs-django ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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
There was a problem hiding this 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!
index on your model. {+django-odm+} creates the same index on your | ||
MongoDB collection that the model represents. |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
source/model-data/indexes.txt
Outdated
- :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/>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broken link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-46327
Staging Links
Self-Review Checklist