Skip to content
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

feat: mongo bundle + nova #3

Open
theodorDiaconu opened this issue Dec 25, 2024 · 0 comments
Open

feat: mongo bundle + nova #3

theodorDiaconu opened this issue Dec 25, 2024 · 0 comments

Comments

@theodorDiaconu
Copy link
Collaborator

theodorDiaconu commented Dec 25, 2024

Concept

Think about properly separating concerns. Should this be a @bluelibs/x2 successor that is comprised of reusable modules based on this core-foundation?

Features

Migrations
Behaviors
Relational Support + Nova Integration
Validation
Hook a global event system

register: [
   mongo.with({
     connections: {
        main: {
           uri: "",
           options: {},     
           collections: [ usersCollection ],
        }
     },
     migrations: [],
   }),
   
]

const usersCollection = resource({
  id: "collections.users",
  dependencies: { mongo },
  async init(_, { mongo }) {
     // mongo.use("other").createCollection("xxx");
     return mongo.createCollection("users", {
        validate: [],
        behaviors: [],
        model: {},
        links: {},
        indexes: [],
        connection: "main",
     })
  }
task({
  on: mongo.events.insertOne,
  async run(insertOneEvent, {}) { ... }
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

No branches or pull requests

1 participant