Skip to content

default index on status added on nosql models #9

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Masum-Osman
Copy link

@Masum-Osman Masum-Osman commented Sep 1, 2024

Add Index Creation for NoSQL Collections

Description

This pull request introduces the creation of an index on the {{TitleName}} collection to improve query performance based on default status field. Devs may add up their requires fields on that.

Key Changes:

  • Index Creation:

    • Added a new index on the status field in descending order (-1).
    • The createIndexes function is responsible for creating the index when the {{TitleName}}Setup function is called.
  • Setup Function:

    • Introduced the {{TitleName}}Setup function which:
      • Initializes the {{TitleName}}Collection by referencing the {{PluralLowerName}} collection from the MongoDB database.
      • Calls the createIndexes function to ensure the index is created during the setup process.

Benefits:

  • Performance Improvement: The addition of this index is expected to significantly improve query performance, especially for operations filtering by the status field.

Testing:

  • This change should be tested by executing queries on the {{TitleName}} collection to ensure that the index is being utilized as expected.
  • Ensure that the index creation process does not introduce any errors or performance regressions during the collection setup.

Please review the changes and provide feedback.

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.

1 participant