Skip to content

feat(database): disable eager collection creation for all schemas#1554

Open
ChrisPdgn wants to merge 1 commit into
mainfrom
feat/lazy-collection-creation
Open

feat(database): disable eager collection creation for all schemas#1554
ChrisPdgn wants to merge 1 commit into
mainfrom
feat/lazy-collection-creation

Conversation

@ChrisPdgn

Copy link
Copy Markdown
Contributor

Summary

  • Set autoCreate: false and autoIndex: false on every Mongoose schema in the database adapter, not just views.
  • Collections are now created lazily on first write instead of at schema registration time, reducing empty collections on shared dev MongoDB clusters.
  • Index creation remains handled explicitly by Conduit's createIndexes() during schema registration.

Test plan

  • Start Conduit with MongoDB and register schemas that have no custom indexes; verify no empty collections are created until the first document insert.
  • Register a schema with custom indexes and confirm indexes are still created correctly.
  • Run findMany / findOne against a schema whose collection has not been created yet and confirm empty results are returned without errors.
  • Verify view schemas still behave correctly.

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