Skip to content

Comments

default index on status added on nosql models#9

Open
Masum-Osman wants to merge 1 commit intoShipu:masterfrom
Masum-Osman:feat/index_on_nosql_model
Open

default index on status added on nosql models#9
Masum-Osman wants to merge 1 commit intoShipu:masterfrom
Masum-Osman:feat/index_on_nosql_model

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