Michaël Zasso
Michaël Zasso
Should we also define fields using decorators? The current approach is simpler, but introduces issues, like it is impossible to type the precise list of fields that are saved to...
Decorators such as `beforeSave`, `beforeCreate`, ...
 We do not want to write documentation before the module is ready.
Sounds useful. Would you like to do a PR?
Hello, nothing yet directly from the Model, but you can already do aggregations using the Collection object: ``` const collection = await Model.getCollection(); collection.aggregate(...) ``` https://mongodb.github.io/node-mongodb-native/4.1/classes/Collection.html#aggregate
This is not the default type, as there is no way to have a "default" for exported values. Try to put `ObjectId` here, it will break the package.
Feel free to try it, but this change didn't work when I implemented the typings. I agree that `unknown` is not the best thing here, but I haven't found an...
Opened https://github.com/adonisjs/core/pull/2273 to try and fix this
Models are proxies on the data that currently only intercept `get` and `set` operations: https://github.com/zakodium/adonis-mongodb/blob/main/src/Model/proxyHandler.ts I think we could support spreading with an `ownKeys` interceptor. Do you expect that `{...modelInstance}`...
Daniel's idea: make `{...modelInstance}` similar to `instance.toJSON()`