Skip to content

Conversation

@digorgonzola
Copy link
Contributor

@digorgonzola digorgonzola commented Jul 1, 2025

Problem: When defining custom index names in model settings, the connector was ignoring the specified name option and falling back to MongoDB's default naming convention (e.g., "archived_1" instead of "archived").

Root Cause: The createIndex() call was missing the options parameter, so custom index options including the name field were not being passed to MongoDB.

Solution: Updated the createIndex() call to include the index.options parameter:

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine (fails 1 test but this is unrelated)
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@rahulrkr08
Copy link

Adding +1 for this. xxx-alpha.5 version is breaking migration (index creation).

@dhmlau dhmlau merged commit c6ce263 into loopbackio:master Jul 28, 2025
6 of 15 checks passed
@dhmlau
Copy link
Member

dhmlau commented Jul 28, 2025

@digorgonzola, thanks for your contribution. Your PR has landed! 🎉

@digorgonzola digorgonzola deleted the fix/pass-index-options branch July 29, 2025 23:26
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.

3 participants